Changeset 90
- Timestamp:
- 03/23/2009 08:46:31 PM (3 years ago)
- Location:
- trunk/WordPress/plugin/transposh
- Files:
-
- 2 edited
-
parser.php (modified) (2 diffs)
-
transposh.php (modified) (1 diff)
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 ?> -
trunk/WordPress/plugin/transposh/transposh.php
r89 r90 415 415 416 416 $ref=getenv('HTTP_REFERER'); 417 $original = base64_ decode($_POST['token'], TRUE);417 $original = base64_url_decode($_POST['token']); 418 418 $translation = $_POST['translation']; 419 419 $lang = $_POST['lang'];
Note: See TracChangeset
for help on using the changeset viewer.
