- Timestamp:
- 08/07/2011 02:04:22 AM (10 months ago)
- Location:
- trunk/WordPress/plugin/transposh
- Files:
-
- 3 edited
-
core/utils.php (modified) (7 diffs)
-
transposh.php (modified) (2 diffs)
-
wp/transposh_widget.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WordPress/plugin/transposh/core/utils.php
r658 r659 59 59 //cleanup lang identifier in permalinks 60 60 //remove the language from the url permalink (if in start of path, and is a defined language) 61 $home_path = rtrim( parse_url($home_url, PHP_URL_PATH), "/");61 $home_path = rtrim(@parse_url($home_url, PHP_URL_PATH), "/"); 62 62 logger("home: $home_path " . $parsedurl['path'], 5); 63 63 if ($home_path && strpos($parsedurl['path'], $home_path) === 0) { … … 67 67 } 68 68 69 if ( strlen($parsedurl['path']) > 2) {69 if (@strlen($parsedurl['path']) > 2) { 70 70 $secondslashpos = strpos($parsedurl['path'], "/", 1); 71 71 if (!$secondslashpos) $secondslashpos = strlen($parsedurl['path']); … … 100 100 $newurl = str_replace('&', '&', $url); 101 101 $newurl = html_entity_decode($newurl, ENT_NOQUOTES); 102 $parsedurl = parse_url($newurl);102 $parsedurl = @parse_url($newurl); 103 103 104 104 // if we are dealing with some other url, we won't touch it! 105 if (isset($parsedurl['host']) && !($parsedurl['host'] == parse_url($home_url, PHP_URL_HOST))) {105 if (isset($parsedurl['host']) && !($parsedurl['host'] == @parse_url($home_url, PHP_URL_HOST))) { 106 106 return $url; 107 107 } … … 120 120 // remove the language from the url permalink (if in start of path, and is a defined language) 121 121 $gluebackhome = false; 122 $home_path = rtrim( parse_url($home_url, PHP_URL_PATH), "/");122 $home_path = rtrim(@parse_url($home_url, PHP_URL_PATH), "/"); 123 123 logger("home: $home_path " . $parsedurl['path'], 5); 124 124 if ($home_path && strpos($parsedurl['path'], $home_path) === 0) { … … 191 191 // cleanup lang identifier in permalinks 192 192 // remove the language from the url permalink (if in start of path, and is a defined language) 193 $home_path = rtrim( parse_url($home_url, PHP_URL_PATH), "/");193 $home_path = rtrim(@parse_url($home_url, PHP_URL_PATH), "/"); 194 194 // logger ("home: $home_path ".$parsedurl['path'],5); 195 195 if ($home_path && strpos($parsedurl['path'], $home_path) === 0) { … … 335 335 else $url2 .= '/' . $part; 336 336 } 337 if ($url2 == '') $url2 = '/';337 if ($url2 == '') $url2 = '/'; 338 338 // TODO: Consider sanitize_title_with_dashes 339 339 // TODO : need to handle params.... … … 341 341 //if (substr($url,strlen($url)-1) == '/') $url2 .= '/'; 342 342 //$url2 = rtrim($url2,'/'); 343 // logger ("$href $url$url2");343 // logger("h $home_url hr $href ur $url ur2 $url2"); 344 344 //$href = $this->home_url.$url2; 345 345 if (substr($href, strlen($href) - 1) == '/') $url2.='/'; 346 return $home_url . $url2.$params; 346 $url2 = str_replace('//', '/', $url2); 347 return $home_url . $url2 . $params; 347 348 } 348 349 -
trunk/WordPress/plugin/transposh/transposh.php
r639 r659 725 725 */ 726 726 function add_rel_alternate() { 727 if (is_404()) return; 727 728 $widget_args = $this->widget->create_widget_args(true, $this->get_clean_url()); 728 729 logger($widget_args, 4); … … 862 863 function pre_post_search($query) { 863 864 logger('pre post', 4); 864 logger($query->query_vars );865 logger($query->query_vars, 4); 865 866 // we hide the search query var from further proccesing, because we do this later 866 867 if ($query->query_vars['s']) { -
trunk/WordPress/plugin/transposh/wp/transposh_widget.php
r601 r659 152 152 $widget_args = array(); 153 153 $page_url = ''; 154 if (is_404()) { 155 $clean_page_url = transposh_utils::cleanup_url($this->transposh->home_url,$this->transposh->home_url,true); 156 } 154 157 // loop on the languages 155 158 foreach ($this->transposh->options->get_sorted_langs() as $code => $langrecord) {
Note: See TracChangeset
for help on using the changeset viewer.
