Changeset 110


Ignore:
Timestamp:
03/27/2009 09:31:54 AM (3 years ago)
Author:
amir
Message:

Fixing the &/& characters within url.

Location:
trunk/WordPress/plugin/transposh
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/transposh.php

    r107 r110  
    144144        global $home_url, $home_url_quoted, $enable_permalinks_rewrite; 
    145145 
     146        $url = html_entity_decode($url, ENT_NOQUOTES); 
     147         
    146148        if(!$enable_permalinks_rewrite) 
    147149        { 
     
    152154        if($is_edit) 
    153155        { 
    154                 $params = EDIT_PARAM . '=1&'; 
     156                $params = EDIT_PARAM . '=1&'; 
    155157 
    156158        } 
     
    158160        if($use_params_only) 
    159161        { 
    160                 $params .= LANG_PARAM . "=$lang&"; 
     162                $params .= LANG_PARAM . "=$lang&"; 
    161163        } 
    162164        else 
     
    179181 
    180182        // more cleanups 
     183        $url = preg_replace("/&$/", "", $url); 
    181184        $url = preg_replace("/\?$/", "", $url); 
    182         $url = preg_replace("/&$/", "", $url); 
     185                 
     186        $url = htmlentities($url, ENT_NOQUOTES); 
     187         
    183188        return $url; 
    184189} 
  • trunk/WordPress/plugin/transposh/transposh_widget.php

    r108 r110  
    4545                        $is_edit = $_POST[EDIT_PARAM]; 
    4646                        $ref = rewrite_url_lang_param($ref, $lang, $is_edit); 
     47                         
     48                        //ref is generated with html entities encoded, needs to be 
     49                        //decoded when used in the http header (i.e. 302 redirect) 
     50                        $ref = html_entity_decode($ref, ENT_NOQUOTES); 
    4751                } 
    4852 
Note: See TracChangeset for help on using the changeset viewer.