Plugin Directory

Changeset 373234


Ignore:
Timestamp:
04/15/2011 11:34:07 AM (15 years ago)
Author:
stevevls
Message:

bugfix : on some systems, apache is pre-decoding 3 byte codes but not 2 byte codes...broke permalinks for asian languages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gts-translation/tags/1.1.6/wordpress/GtsLinkRewriter.php

    r373063 r373234  
    284284                        // $_SERVER array for the REQUEST_URI.  it then "sanitizes" it, which for us means removing all
    285285                        // extended UTF-8 characters.  we'll need to fix that here or risk categories not working...
    286                         if ( $encoded_val != $query_vars[ $param_name ] ) {
    287                             $_SERVER['REQUEST_URI'] = str_replace( $encoded_val, $query_vars[ $param_name ], $_SERVER['REQUEST_URI'] );
    288                         }
     286                        //
     287                        // what's even stranger, in some cases, the value is already decoded but in others no.  i've witnessed
     288                        // this on systems where Russian (2 byte codes) is encoded but Japanese (3 byte codes) is not.  freaking
     289                        // weird...
     290                        $to_replace = $encoded_val != $query_vars[$param_name] ? $encoded_val : urlencode($query_vars[$param_name]);
     291                        $_SERVER['REQUEST_URI'] = str_replace( $to_replace, $query_vars[ $param_name ], $_SERVER['REQUEST_URI'] );
    289292                    }
    290293                }
Note: See TracChangeset for help on using the changeset viewer.