Index: branches/5.2.x/core/kernel/managers/rewrite_url_processor.php =================================================================== diff -u -N -r14753 -r14787 --- branches/5.2.x/core/kernel/managers/rewrite_url_processor.php (.../rewrite_url_processor.php) (revision 14753) +++ branches/5.2.x/core/kernel/managers/rewrite_url_processor.php (.../rewrite_url_processor.php) (revision 14787) @@ -68,10 +68,19 @@ * Possible url endings from ModRewriteUrlEnding configuration variable * * @var Array + * @access protected */ protected $_urlEndings = Array ('.html', '/', ''); /** + * Factory storage sub-set, containing mod-rewrite listeners, used during url building and parsing + * + * @var Array + * @access protected + */ + protected $rewriteListeners = Array (); + + /** * Constructor of kRewriteUrlProcessor class * * @param $manager @@ -280,9 +289,11 @@ foreach ($this->Application->RewriteListeners as $prefix => $listener_data) { foreach ($listener_data['listener'] as $index => $rewrite_listener) { list ($listener_prefix, $listener_method) = explode(':', $rewrite_listener); - $listener =& $this->Application->recallObject($listener_prefix); - $this->Application->RewriteListeners[$prefix][$index] = Array (&$listener, $listener_method); + // don't use temp variable, since it will swap objects in Factory in PHP5 + $this->rewriteListeners[$prefix][$index] = Array (); + $this->rewriteListeners[$prefix][$index][0] =& $this->Application->recallObject($listener_prefix); + $this->rewriteListeners[$prefix][$index][1] = $listener_method; } } @@ -415,7 +426,7 @@ $this->_initRewriteListeners(); $page_number = $this->_parsePage($url_parts, $vars); - foreach ($this->Application->RewriteListeners as $prefix => $listeners) { + foreach ($this->rewriteListeners as $prefix => $listeners) { // set default page // $vars[$prefix . '_Page'] = 1; // will override page in session in case, when none is given in url @@ -838,7 +849,7 @@ list ($prefix) = explode('.', $pass_element); $catalog_item = $this->Application->findModule('Var', $prefix) && $this->Application->getUnitOption($prefix, 'CatalogItem'); - if ( array_key_exists($prefix, $this->Application->RewriteListeners) ) { + if ( array_key_exists($prefix, $this->rewriteListeners) ) { // if next prefix is same as current, but with special => exclude current prefix from url $next_prefix = array_key_exists($pass_index + 1, $pass_info) ? $pass_info[$pass_index + 1] : false; if ( $next_prefix ) { @@ -956,7 +967,7 @@ list ($prefix) = explode('.', $prefix_special); $url_parts = Array (); - $listener = $this->Application->RewriteListeners[$prefix][0]; + $listener = $this->rewriteListeners[$prefix][0]; $ret = $listener[0]->$listener[1](REWRITE_MODE_BUILD, $prefix_special, $params, $url_parts, $pass_events);