Changeset 3127 for branches/2.0/include/functions_url.inc.php
- Timestamp:
- Feb 5, 2009, 4:04:27 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/include/functions_url.inc.php
r3046 r3127 39 39 $root_url = PHPWG_ROOT_PATH; 40 40 } 41 if ( dirname($root_url)!='.')41 if ( strncmp($root_url, './', 2) != 0 ) 42 42 { 43 43 return $root_url; … … 171 171 global $page; 172 172 173 if (count($removed) > 0) 174 { 175 $params = array(); 176 177 foreach ($page as $page_item_key => $page_item_value) 178 { 179 if (!in_array($page_item_key, $removed)) 180 { 181 $params[$page_item_key] = $page_item_value; 182 } 183 } 184 } 185 else 186 { 187 $params = $page; 173 $params = $page; 174 175 foreach ($removed as $param_key) 176 { 177 unset($params[$param_key]); 188 178 } 189 179 … … 723 713 function embellish_url($url) 724 714 { 725 return str_replace('/./', '/', $url); 715 $url = str_replace('/./', '/', $url); 716 while ( ($dotdot = strpos($url, '/../', 1) ) !== false ) 717 { 718 $before = strrpos($url, '/', -(strlen($url)-$dotdot+1) ); 719 if ($before !== false) 720 { 721 $url = substr_replace($url, '', $before, $dotdot-$before+3); 722 } 723 else 724 break; 725 } 726 return $url; 726 727 } 727 728
Note: See TracChangeset
for help on using the changeset viewer.