Changeset 3293830
- Timestamp:
- 05/15/2025 07:20:27 AM (11 months ago)
- Location:
- easytranslate
- Files:
-
- 4 edited
- 18 copied
-
tags/v5.4 (copied) (copied from easytranslate/trunk)
-
tags/v5.4/README.txt (copied) (copied from easytranslate/trunk/README.txt) (1 diff)
-
tags/v5.4/admin/class-easy-translate-admin.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-admin.php)
-
tags/v5.4/admin/class-easy-translate-api-integration.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-api-integration.php)
-
tags/v5.4/admin/class-easy-translate-api-laas.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-api-laas.php)
-
tags/v5.4/admin/class-easy-translate-api-service.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-api-service.php)
-
tags/v5.4/admin/class-easy-translate-post-translation-list.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-post-translation-list.php)
-
tags/v5.4/admin/class-easy-translate-projects.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-projects.php)
-
tags/v5.4/admin/class-easy-translate-string-translation-list.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-string-translation-list.php)
-
tags/v5.4/admin/class-easy-translate-translation-list.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-translation-list.php)
-
tags/v5.4/admin/class-easy-translate-translation-updater.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-translation-updater.php)
-
tags/v5.4/admin/class-easy-translate-translation.php (copied) (copied from easytranslate/trunk/admin/class-easy-translate-translation.php)
-
tags/v5.4/admin/functions.php (modified) (1 diff)
-
tags/v5.4/admin/js/easy-translate-admin.js (copied) (copied from easytranslate/trunk/admin/js/easy-translate-admin.js)
-
tags/v5.4/admin/partials/projects.php (copied) (copied from easytranslate/trunk/admin/partials/projects.php)
-
tags/v5.4/admin/partials/requirements.php (copied) (copied from easytranslate/trunk/admin/partials/requirements.php)
-
tags/v5.4/admin/partials/translation-options.php (copied) (copied from easytranslate/trunk/admin/partials/translation-options.php)
-
tags/v5.4/easy-translate.php (copied) (copied from easytranslate/trunk/easy-translate.php) (2 diffs)
-
tags/v5.4/includes/class-easy-translate.php (copied) (copied from easytranslate/trunk/includes/class-easy-translate.php)
-
trunk/README.txt (modified) (1 diff)
-
trunk/admin/functions.php (modified) (1 diff)
-
trunk/easy-translate.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easytranslate/tags/v5.4/README.txt
r3281341 r3293830 5 5 Requires at least: 4.7 6 6 Tested up to: 6.8 7 Stable tag: 5. 37 Stable tag: 5.4 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
easytranslate/tags/v5.4/admin/functions.php
r2866487 r3293830 201 201 } 202 202 203 /** 204 * Verifies that a correct security nonce was used with time limit. 205 * 206 * @param $nonce 207 * @param int $action 208 * @return bool|int 209 */ 210 function wp_verify_nonce($nonce, $action = -1) 211 { 212 213 if ($action === 'icl_st_save_translation_nonce') { 214 return 1; 203 if (!function_exists('wp_verify_nonce')) { 204 /** 205 * Verifies that a correct security nonce was used with time limit. 206 * 207 * @param $nonce 208 * @param int $action 209 * @return bool|int 210 */ 211 function wp_verify_nonce($nonce, $action = -1) 212 { 213 214 if ($action === 'icl_st_save_translation_nonce') { 215 return 1; 216 } 217 218 $nonce = (string)$nonce; 219 $user = wp_get_current_user(); 220 $uid = (int)$user->ID; 221 if (!$uid) { 222 /** 223 * Filters whether the user who generated the nonce is logged out. 224 * 225 * @param int $uid ID of the nonce-owning user. 226 * @param string $action The nonce action. 227 * @since 3.5.0 228 */ 229 $uid = apply_filters('nonce_user_logged_out', $uid, $action); 230 } 231 232 if (empty($nonce)) { 233 return false; 234 } 235 236 $token = wp_get_session_token(); 237 $i = wp_nonce_tick(); 238 239 // Nonce generated 0-12 hours ago. 240 $expected = substr(wp_hash($i . '|' . $action . '|' . $uid . '|' . $token, 'nonce'), -12, 10); 241 if (hash_equals($expected, $nonce)) { 242 return 1; 243 } 244 245 // Nonce generated 12-24 hours ago. 246 $expected = substr(wp_hash(($i - 1) . '|' . $action . '|' . $uid . '|' . $token, 'nonce'), -12, 10); 247 if (hash_equals($expected, $nonce)) { 248 return 2; 249 } 250 251 /** 252 * Fires when nonce verification fails. 253 * 254 * @param string $nonce The invalid nonce. 255 * @param string|int $action The nonce action. 256 * @param WP_User $user The current user object. 257 * @param string $token The user's session token. 258 * @since 4.4.0 259 */ 260 do_action('wp_verify_nonce_failed', $nonce, $action, $user, $token); 261 262 // Invalid nonce. 263 return false; 264 215 265 } 216 217 $nonce = (string)$nonce; 218 $user = wp_get_current_user(); 219 $uid = (int)$user->ID; 220 if (!$uid) { 221 /** 222 * Filters whether the user who generated the nonce is logged out. 223 * 224 * @param int $uid ID of the nonce-owning user. 225 * @param string $action The nonce action. 226 * @since 3.5.0 227 */ 228 $uid = apply_filters('nonce_user_logged_out', $uid, $action); 229 } 230 231 if (empty($nonce)) { 232 return false; 233 } 234 235 $token = wp_get_session_token(); 236 $i = wp_nonce_tick(); 237 238 // Nonce generated 0-12 hours ago. 239 $expected = substr(wp_hash($i . '|' . $action . '|' . $uid . '|' . $token, 'nonce'), -12, 10); 240 if (hash_equals($expected, $nonce)) { 241 return 1; 242 } 243 244 // Nonce generated 12-24 hours ago. 245 $expected = substr(wp_hash(($i - 1) . '|' . $action . '|' . $uid . '|' . $token, 'nonce'), -12, 10); 246 if (hash_equals($expected, $nonce)) { 247 return 2; 248 } 249 250 /** 251 * Fires when nonce verification fails. 252 * 253 * @param string $nonce The invalid nonce. 254 * @param string|int $action The nonce action. 255 * @param WP_User $user The current user object. 256 * @param string $token The user's session token. 257 * @since 4.4.0 258 */ 259 do_action('wp_verify_nonce_failed', $nonce, $action, $user, $token); 260 261 // Invalid nonce. 262 return false; 263 264 } 266 } -
easytranslate/tags/v5.4/easy-translate.php
r3281341 r3293830 15 15 * Plugin URI: https://www.easytranslate.com/en/integrations/cms/wordpress-plugin/ 16 16 * Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area. 17 * Version: 2.0. 217 * Version: 2.0.3 18 18 * Author: EasyTranslate 19 19 * Author URI: https://easytranslate.com … … 34 34 * Rename this for your plugin and update it as you release new versions. 35 35 */ 36 define('EASY_TRANSLATE_VERSION', '2.0. 2');36 define('EASY_TRANSLATE_VERSION', '2.0.3'); 37 37 38 38 /** -
easytranslate/trunk/README.txt
r3281341 r3293830 5 5 Requires at least: 4.7 6 6 Tested up to: 6.8 7 Stable tag: 5. 37 Stable tag: 5.4 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
easytranslate/trunk/admin/functions.php
r2866487 r3293830 201 201 } 202 202 203 /** 204 * Verifies that a correct security nonce was used with time limit. 205 * 206 * @param $nonce 207 * @param int $action 208 * @return bool|int 209 */ 210 function wp_verify_nonce($nonce, $action = -1) 211 { 212 213 if ($action === 'icl_st_save_translation_nonce') { 214 return 1; 203 if (!function_exists('wp_verify_nonce')) { 204 /** 205 * Verifies that a correct security nonce was used with time limit. 206 * 207 * @param $nonce 208 * @param int $action 209 * @return bool|int 210 */ 211 function wp_verify_nonce($nonce, $action = -1) 212 { 213 214 if ($action === 'icl_st_save_translation_nonce') { 215 return 1; 216 } 217 218 $nonce = (string)$nonce; 219 $user = wp_get_current_user(); 220 $uid = (int)$user->ID; 221 if (!$uid) { 222 /** 223 * Filters whether the user who generated the nonce is logged out. 224 * 225 * @param int $uid ID of the nonce-owning user. 226 * @param string $action The nonce action. 227 * @since 3.5.0 228 */ 229 $uid = apply_filters('nonce_user_logged_out', $uid, $action); 230 } 231 232 if (empty($nonce)) { 233 return false; 234 } 235 236 $token = wp_get_session_token(); 237 $i = wp_nonce_tick(); 238 239 // Nonce generated 0-12 hours ago. 240 $expected = substr(wp_hash($i . '|' . $action . '|' . $uid . '|' . $token, 'nonce'), -12, 10); 241 if (hash_equals($expected, $nonce)) { 242 return 1; 243 } 244 245 // Nonce generated 12-24 hours ago. 246 $expected = substr(wp_hash(($i - 1) . '|' . $action . '|' . $uid . '|' . $token, 'nonce'), -12, 10); 247 if (hash_equals($expected, $nonce)) { 248 return 2; 249 } 250 251 /** 252 * Fires when nonce verification fails. 253 * 254 * @param string $nonce The invalid nonce. 255 * @param string|int $action The nonce action. 256 * @param WP_User $user The current user object. 257 * @param string $token The user's session token. 258 * @since 4.4.0 259 */ 260 do_action('wp_verify_nonce_failed', $nonce, $action, $user, $token); 261 262 // Invalid nonce. 263 return false; 264 215 265 } 216 217 $nonce = (string)$nonce; 218 $user = wp_get_current_user(); 219 $uid = (int)$user->ID; 220 if (!$uid) { 221 /** 222 * Filters whether the user who generated the nonce is logged out. 223 * 224 * @param int $uid ID of the nonce-owning user. 225 * @param string $action The nonce action. 226 * @since 3.5.0 227 */ 228 $uid = apply_filters('nonce_user_logged_out', $uid, $action); 229 } 230 231 if (empty($nonce)) { 232 return false; 233 } 234 235 $token = wp_get_session_token(); 236 $i = wp_nonce_tick(); 237 238 // Nonce generated 0-12 hours ago. 239 $expected = substr(wp_hash($i . '|' . $action . '|' . $uid . '|' . $token, 'nonce'), -12, 10); 240 if (hash_equals($expected, $nonce)) { 241 return 1; 242 } 243 244 // Nonce generated 12-24 hours ago. 245 $expected = substr(wp_hash(($i - 1) . '|' . $action . '|' . $uid . '|' . $token, 'nonce'), -12, 10); 246 if (hash_equals($expected, $nonce)) { 247 return 2; 248 } 249 250 /** 251 * Fires when nonce verification fails. 252 * 253 * @param string $nonce The invalid nonce. 254 * @param string|int $action The nonce action. 255 * @param WP_User $user The current user object. 256 * @param string $token The user's session token. 257 * @since 4.4.0 258 */ 259 do_action('wp_verify_nonce_failed', $nonce, $action, $user, $token); 260 261 // Invalid nonce. 262 return false; 263 264 } 266 } -
easytranslate/trunk/easy-translate.php
r3281341 r3293830 15 15 * Plugin URI: https://www.easytranslate.com/en/integrations/cms/wordpress-plugin/ 16 16 * Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area. 17 * Version: 2.0. 217 * Version: 2.0.3 18 18 * Author: EasyTranslate 19 19 * Author URI: https://easytranslate.com … … 34 34 * Rename this for your plugin and update it as you release new versions. 35 35 */ 36 define('EASY_TRANSLATE_VERSION', '2.0. 2');36 define('EASY_TRANSLATE_VERSION', '2.0.3'); 37 37 38 38 /**
Note: See TracChangeset
for help on using the changeset viewer.