Changeset 114
- Timestamp:
- 03/28/2009 09:29:36 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/WordPress/plugin/transposh/transposh_db.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WordPress/plugin/transposh/transposh_db.php
r102 r114 19 19 20 20 /** 21 * Contains db realated function which are likely to be specific for each environment. 21 * Contains db realated function which are likely to be specific for each environment. 22 22 * This implementation for use with mysql within wordpress 23 * 23 * 24 24 */ 25 25 … … 98 98 } 99 99 100 /* 101 * Helper function for annoying strings from php escape (%u2019) 102 */ 103 function utf8_urldecode($str) { 104 $str = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($str)); 105 return html_entity_decode($str,null,'UTF-8');; 106 } 100 107 101 108 /* … … 108 115 $ref=getenv('HTTP_REFERER'); 109 116 $original = base64_url_decode($_POST['token']); 110 $translation = $_POST['translation'];117 $translation = utf8_urldecode($_POST['translation']); 111 118 $lang = $_POST['lang']; 112 119 $source = $_POST['source']; … … 123 130 logger("Unauthorized translation attempt " . $_SERVER['REMOTE_ADDR'] , 1); 124 131 } 125 132 126 133 $table_name = $wpdb->prefix . TRANSLATIONS_TABLE; 127 134 128 135 //Decode & remove already escaped character to avoid double escaping 129 136 $translation = $wpdb->escape(htmlspecialchars(stripslashes(urldecode($translation))));
Note: See TracChangeset
for help on using the changeset viewer.
