Index: trunk/core/kernel/utility/http_query.php =================================================================== diff -u -N -r4758 -r4850 --- trunk/core/kernel/utility/http_query.php (.../http_query.php) (revision 4758) +++ trunk/core/kernel/utility/http_query.php (.../http_query.php) (revision 4850) @@ -360,51 +360,18 @@ // env=SID:TEMPLATE:m-1-1-1-1:l0-0-0:n-0-0-0:bb-0-0-1-1-1-0 $env_var = $this->Get(ENV_VAR_NAME); - if($env_var) - { + if ($env_var) { + // replace escaped ":" symbol not to explode by it $env_var = str_replace('\:','_&+$$+&_', $env_var); // replace escaped "=" with spec-chars :) $parts = explode(':', $env_var); - if( !$this->Application->RewriteURLs() || ($this->Application->RewriteURLs() && $this->Get('rewrite') != 'on') ) - { + if (!$this->Application->RewriteURLs() || ($this->Application->RewriteURLs() && $this->Get('rewrite') != 'on')) { $this->extractSIDAndTemplate($parts); } - if($parts) - { - $query_maps = Array(); - $event_manger =& $this->Application->recallObject('EventManager'); - - $passed = Array(); - - foreach($parts as $mixed_part) - { - //In-portal old style env conversion - adds '-' between prefix and first var - $mixed_part = str_replace('_&+$$+&_',':',$mixed_part); - $mixed_part = preg_replace("/^([a-zA-Z]+)([0-9]+)-(.*)/", "$1-$2-$3", $mixed_part); - - $escaped_part = str_replace('\-', '_&+$$+&_', $mixed_part); - $escaped_part = explode('-', $escaped_part); - - $mixed_part = array(); - foreach ($escaped_part as $escaped_val) { - $mixed_part[] = str_replace('_&+$$+&_', '-', $escaped_val); - } - - $prefix_special = array_shift($mixed_part); // l.pick, l - $query_map = $event_manger->setQueryMap($prefix_special); - $this->Set('passed', implode(',', array_keys($event_manger->queryMaps))); - - // if config is not defined for prefix in QueryString, then don't process it - if ($query_map) { - foreach($query_map as $index => $var_name) - { - // l_id, l_page, l_bla-bla-bla - $val = $mixed_part[$index - 1]; - if ($val == '') $val = false; - $this->Set($prefix_special.'_'.$var_name, $val); - } - } + if ($parts) { + foreach ($parts as $mixed_part) { + $this->parseEnvPart($mixed_part); } } } @@ -414,7 +381,38 @@ $this->Set('t', $t); } } + + function parseEnvPart($mixed_part) + { + // In-portal old style env conversion - adds '-' between prefix and first var + $mixed_part = str_replace('_&+$$+&_', ':', $mixed_part); + $mixed_part = preg_replace("/^([a-zA-Z]+)([0-9]+)-(.*)/", "$1-$2-$3", $mixed_part); + // replace escaped "-" symbol not to explode by it + $escaped_part = str_replace('\-', '_&+$$+&_', $mixed_part); + $escaped_part = explode('-', $escaped_part); + + $mixed_part = Array(); + foreach ($escaped_part as $escaped_val) { + $mixed_part[] = str_replace('_&+$$+&_', '-', $escaped_val); + } + + $prefix_special = array_shift($mixed_part); // l.pick, l + $query_map = $this->Application->EventManager->setQueryMap($prefix_special); + $this->Set('passed', implode(',', array_keys($this->Application->EventManager->queryMaps))); + + // if config is not defined for prefix in QueryString, then don't process it + if ($query_map) { + foreach($query_map as $index => $var_name) + { + // l_id, l_page, l_bla-bla-bla + $val = $mixed_part[$index - 1]; + if ($val == '') $val = false; + $this->Set($prefix_special.'_'.$var_name, $val); + } + } + } + /** * Decides what template name to * use from $_GET or from $_POST