Index: branches/5.2.x/core/kernel/managers/url_manager.php =================================================================== diff -u -N -r14585 -r14628 --- branches/5.2.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 14585) +++ branches/5.2.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 14628) @@ -1,6 +1,6 @@ Application->recallObject('Session'); + /* @var $session Session */ + $ssl = isset($params['__SSL__']) ? $params['__SSL__'] : 0; $sid = $session->NeedQueryString() && !$this->Application->RewriteURLs($ssl) ? $this->Application->GetSID() : ''; // if (getArrayValue($params,'admin') == 1) $sid = $this->Application->GetSID(); @@ -495,39 +497,46 @@ * @param string $prefix_special item's prefix & [special] * @param Array $params url params * @param bool $pass_events + * @return string + * @access protected */ - function BuildModuleEnv($prefix_special, &$params, $pass_events = false) + protected function BuildModuleEnv($prefix_special, &$params, $pass_events = false) { list($prefix) = explode('.', $prefix_special); - $query_vars = $this->Application->getUnitOption($prefix, 'QueryString'); + $query_vars = $this->Application->getUnitOption($prefix, 'QueryString', Array ()); + /* @var $query_vars Array */ - //if pass events is off and event is not implicity passed - if( !$pass_events && !isset($params[$prefix_special.'_event']) ) { - $params[$prefix_special.'_event'] = ''; // remove event from url if requested + //if pass events is off and event is not implicitly passed + if ( !$pass_events && !isset($params[$prefix_special . '_event']) ) { + $params[$prefix_special . '_event'] = ''; // remove event from url if requested //otherwise it will use value from get_var } - if(!$query_vars) return ''; + if ( !$query_vars ) { + return ''; + } - $tmp_string = Array(0 => $prefix_special); - foreach($query_vars as $index => $var_name) - { + $tmp_string = Array (0 => $prefix_special); + foreach ($query_vars as $index => $var_name) { //if value passed in params use it, otherwise use current from application - $var_name = $prefix_special.'_'.$var_name; - $tmp_string[$index] = isset( $params[$var_name] ) ? $params[$var_name] : $this->Application->GetVar($var_name); - if ( isset($params[$var_name]) ) unset( $params[$var_name] ); + $var_name = $prefix_special . '_' . $var_name; + $tmp_string[$index] = isset($params[$var_name]) ? $params[$var_name] : $this->Application->GetVar($var_name); + + if ( isset($params[$var_name]) ) { + unset($params[$var_name]); + } } - $escaped = array(); + $escaped = array (); foreach ($tmp_string as $tmp_val) { - $escaped[] = str_replace(Array('-',':'), Array('\-','\:'), $tmp_val); + $escaped[] = str_replace(Array ('-', ':'), Array ('\-', '\:'), $tmp_val); } $ret = implode('-', $escaped); - if ($this->Application->getUnitOption($prefix, 'PortalStyleEnv') == true) - { - $ret = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/','\\1\\2-\\3', $ret); + if ( $this->Application->getUnitOption($prefix, 'PortalStyleEnv') == true ) { + $ret = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/', '\\1\\2-\\3', $ret); } + return $ret; }