Changeset 90 for trunk/WordPress/plugin/transposh/parser.php
- Timestamp:
- 03/23/2009 08:46:31 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/WordPress/plugin/transposh/parser.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WordPress/plugin/transposh/parser.php
r84 r90 787 787 //Use base64 encoding to make that when the page is translated (i.e. update_translation) we 788 788 //get back exactlly the same string without having the client decode/encode it in anyway. 789 $token = "token=\"" . base64_ encode($original_text) . "\"";789 $token = "token=\"" . base64_url_encode($original_text) . "\""; 790 790 791 791 if($translated_text == NULL) … … 876 876 877 877 } 878 879 /** 880 * Encode a string as base 64 while avoiding characters which should be avoided 881 * in uri, e.g. + is interpeted as a space. 882 */ 883 function base64_url_encode($input) { 884 return strtr(base64_encode($input), '+/=', '-_,'); 885 } 886 887 /** 888 * Decode a string previously decoded with base64_url_encode 889 */ 890 function base64_url_decode($input) { 891 return base64_decode(strtr($input, '-_,', '+/=')); 892 } 893 878 894 ?>
Note: See TracChangeset
for help on using the changeset viewer.
