Changeset 3353726
- Timestamp:
- 09/01/2025 08:32:36 AM (3 months ago)
- Location:
- falang
- Files:
-
- 6 edited
- 1 copied
-
tags/1.3.66 (copied) (copied from falang/trunk)
-
tags/1.3.66/README.txt (modified) (2 diffs)
-
tags/1.3.66/admin/class-falang-admin.php (modified) (8 diffs)
-
tags/1.3.66/public/class-falang-public.php (modified) (2 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/class-falang-admin.php (modified) (8 diffs)
-
trunk/public/class-falang-public.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
falang/tags/1.3.66/README.txt
r3338154 r3353726 6 6 Tested up to: 6.8 7 7 Requires PHP: 5.6 8 Stable tag: 1.3.6 58 Stable tag: 1.3.66 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 111 111 == Changelog == 112 112 113 * 1.3.66 (2025/09/01) 114 * fix theme editor save with slug 115 * fix bug with permalink since woocommerce 10.0.0 116 * fix object injection vulnerability's 117 113 118 * 1.3.65 (2025/08/02) 114 119 * fix _load_textdomain_just_in_time (thanks to Alexandre Froger) -
falang/tags/1.3.66/admin/class-falang-admin.php
r3291681 r3353726 91 91 * add generic filter for service translation (use first in Elementor) 92 92 * @update 1.3.56 wp_nav_menu_item_custom_fields signature change 93 * @update 1.3.66 add filter for home_url 94 * remove the load-post.php and load-post-new.php (done in the home_filter) 93 95 * */ 94 96 public function load() … … 106 108 // Priority 5 to make sure filters are there before customize_register is fired 107 109 add_action('wp_loaded', array($this, 'add_filters'), 5); 110 111 add_filter('home_url', array($this,'translate_home_url'), 10, 4); 108 112 109 113 //post settings option … … 181 185 // Adds row meta links to the plugin list table aka Documentation and Faq 182 186 add_filter('plugin_row_meta', array($this, 'plugin_row_meta'), 10, 2); 183 184 // on load post.php185 add_action('load-post.php', array($this, 'admin_post_page'));186 add_action('load-post-new.php', array($this, 'admin_post_page'));187 187 188 188 //on post meta-box-display add js … … 715 715 * @update 1.3.35 support serialised array translation 716 716 * @update 1.3.40 flush directly the rules if needed (necessary when page slulg change) 717 * @update 1.3.66 fix object injection in unserialize 717 718 */ 718 719 public function save_translation_post() … … 754 755 if (strlen($field_value) > 0) { 755 756 if (is_serialized($field_value)){ 756 $field_value = unserialize(stripslashes(trim($field_value))); 757 // Safe to unserialize // https://heera.it/the-dangers-of-phps-unserialize-and-how-to-stay-safe 758 if (preg_match('/^[\w:;,.{}()=]+$/', $field_value)) { 759 $field_value = unserialize(stripslashes(trim($field_value)), ['allowed_classes' => false]); 760 update_post_meta($post_id, $meta_key, $field_value); 761 } 757 762 } 758 update_post_meta($post_id, $meta_key, $field_value);759 763 } else { 760 764 delete_post_meta($post_id, $meta_key); … … 2523 2527 2524 2528 2525 /* Posts UI2526 ----------------------------------------------- */2527 2528 /**2529 * Fire filters on post.php2530 *2531 * Hook for 'load-post.php'2532 *2533 * @from 1.2.32534 */2535 public function admin_post_page()2536 {2537 2538 $current_screen = get_current_screen();2539 $falang_post = new \Falang\Core\Post();2540 2541 if ($this->model->get_languages_list() && isset($current_screen->post_type) && $falang_post->is_post_type_translatable($current_screen->post_type)) {2542 2543 // allow translate home url2544 add_filter('home_url', array($this, 'translate_home_url'), 10, 4);2545 2546 }2547 2548 }2549 2550 2529 /** 2551 2530 * Translate post slug … … 2716 2695 2717 2696 /** 2718 * Append language slug to home url2719 * Filter for 'home_url'2697 * Append language slug to home url 2698 * Filter for 'home_url' 2720 2699 * exist for front too 2721 2700 * 2722 2701 * @from 1.0 2702 * @update 1.3.66 translate_home_url is now in the wp_load filter to fix the bug when theme editor save with slug 2703 * for default language 2704 * the method for load-post.php and load-post-new.php is removed 2723 2705 */ 2724 2706 public function translate_home_url($url, $path, $orig_scheme, $blog_id) 2725 2707 { 2726 2708 $language = $this->get_current_language(); 2709 $action = null; 2710 $post_id = null; 2727 2711 2728 2712 //manage specific language on post/page … … 2732 2716 if (isset($_REQUEST['action'])) { 2733 2717 $action = $_REQUEST['action']; 2718 } 2719 2720 //only supported action need to rewrite the home url in backend 2721 //admin_post_page function and edit theme plugin 2722 if (!isset($action) && 'edit' != $action && 'editpost' != $action && 'edit-theme-plugin-file' != $action ){ 2723 return $url; 2734 2724 } 2735 2725 -
falang/tags/1.3.66/public/class-falang-public.php
r3291681 r3353726 107 107 * @update 1.3.60 pub back the load_strings_translations to load 108 108 * @update 1.3.61 call set language to allow WPML ICL_LANGUAGE_CODE and ICL_LANGUAGE_NAME define 109 * @update 1.3.66 remove the fix for theme editor done in class-falang-admin.php (home_url) 109 110 */ 110 111 public function load() { 111 //theme_editor don't like falang with home slug - disable falang for theme editor check112 if (isset($_REQUEST['wp_scrape_key'])){113 return;114 }115 112 116 113 if ($this->current_language = $this->get_current_language()) { … … 165 162 add_filter( 'widget_display_callback', array( $this, 'widget_display_callback' ), 10, 2 ); 166 163 add_filter( 'sidebars_widgets', array( $this, 'sidebars_widgets' ) ); 167 168 169 //TODO check translate the post and the page.170 // add_filter('the_posts', array($this, 'translate_the_posts'), 10, 2);171 // add_filter('get_pages', array($this, 'translate_the_pages'), 10, 2);172 164 173 165 $this->add_options_filters(); -
falang/trunk/README.txt
r3338154 r3353726 6 6 Tested up to: 6.8 7 7 Requires PHP: 5.6 8 Stable tag: 1.3.6 58 Stable tag: 1.3.66 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 111 111 == Changelog == 112 112 113 * 1.3.66 (2025/09/01) 114 * fix theme editor save with slug 115 * fix bug with permalink since woocommerce 10.0.0 116 * fix object injection vulnerability's 117 113 118 * 1.3.65 (2025/08/02) 114 119 * fix _load_textdomain_just_in_time (thanks to Alexandre Froger) -
falang/trunk/admin/class-falang-admin.php
r3291681 r3353726 91 91 * add generic filter for service translation (use first in Elementor) 92 92 * @update 1.3.56 wp_nav_menu_item_custom_fields signature change 93 * @update 1.3.66 add filter for home_url 94 * remove the load-post.php and load-post-new.php (done in the home_filter) 93 95 * */ 94 96 public function load() … … 106 108 // Priority 5 to make sure filters are there before customize_register is fired 107 109 add_action('wp_loaded', array($this, 'add_filters'), 5); 110 111 add_filter('home_url', array($this,'translate_home_url'), 10, 4); 108 112 109 113 //post settings option … … 181 185 // Adds row meta links to the plugin list table aka Documentation and Faq 182 186 add_filter('plugin_row_meta', array($this, 'plugin_row_meta'), 10, 2); 183 184 // on load post.php185 add_action('load-post.php', array($this, 'admin_post_page'));186 add_action('load-post-new.php', array($this, 'admin_post_page'));187 187 188 188 //on post meta-box-display add js … … 715 715 * @update 1.3.35 support serialised array translation 716 716 * @update 1.3.40 flush directly the rules if needed (necessary when page slulg change) 717 * @update 1.3.66 fix object injection in unserialize 717 718 */ 718 719 public function save_translation_post() … … 754 755 if (strlen($field_value) > 0) { 755 756 if (is_serialized($field_value)){ 756 $field_value = unserialize(stripslashes(trim($field_value))); 757 // Safe to unserialize // https://heera.it/the-dangers-of-phps-unserialize-and-how-to-stay-safe 758 if (preg_match('/^[\w:;,.{}()=]+$/', $field_value)) { 759 $field_value = unserialize(stripslashes(trim($field_value)), ['allowed_classes' => false]); 760 update_post_meta($post_id, $meta_key, $field_value); 761 } 757 762 } 758 update_post_meta($post_id, $meta_key, $field_value);759 763 } else { 760 764 delete_post_meta($post_id, $meta_key); … … 2523 2527 2524 2528 2525 /* Posts UI2526 ----------------------------------------------- */2527 2528 /**2529 * Fire filters on post.php2530 *2531 * Hook for 'load-post.php'2532 *2533 * @from 1.2.32534 */2535 public function admin_post_page()2536 {2537 2538 $current_screen = get_current_screen();2539 $falang_post = new \Falang\Core\Post();2540 2541 if ($this->model->get_languages_list() && isset($current_screen->post_type) && $falang_post->is_post_type_translatable($current_screen->post_type)) {2542 2543 // allow translate home url2544 add_filter('home_url', array($this, 'translate_home_url'), 10, 4);2545 2546 }2547 2548 }2549 2550 2529 /** 2551 2530 * Translate post slug … … 2716 2695 2717 2696 /** 2718 * Append language slug to home url2719 * Filter for 'home_url'2697 * Append language slug to home url 2698 * Filter for 'home_url' 2720 2699 * exist for front too 2721 2700 * 2722 2701 * @from 1.0 2702 * @update 1.3.66 translate_home_url is now in the wp_load filter to fix the bug when theme editor save with slug 2703 * for default language 2704 * the method for load-post.php and load-post-new.php is removed 2723 2705 */ 2724 2706 public function translate_home_url($url, $path, $orig_scheme, $blog_id) 2725 2707 { 2726 2708 $language = $this->get_current_language(); 2709 $action = null; 2710 $post_id = null; 2727 2711 2728 2712 //manage specific language on post/page … … 2732 2716 if (isset($_REQUEST['action'])) { 2733 2717 $action = $_REQUEST['action']; 2718 } 2719 2720 //only supported action need to rewrite the home url in backend 2721 //admin_post_page function and edit theme plugin 2722 if (!isset($action) && 'edit' != $action && 'editpost' != $action && 'edit-theme-plugin-file' != $action ){ 2723 return $url; 2734 2724 } 2735 2725 -
falang/trunk/public/class-falang-public.php
r3291681 r3353726 107 107 * @update 1.3.60 pub back the load_strings_translations to load 108 108 * @update 1.3.61 call set language to allow WPML ICL_LANGUAGE_CODE and ICL_LANGUAGE_NAME define 109 * @update 1.3.66 remove the fix for theme editor done in class-falang-admin.php (home_url) 109 110 */ 110 111 public function load() { 111 //theme_editor don't like falang with home slug - disable falang for theme editor check112 if (isset($_REQUEST['wp_scrape_key'])){113 return;114 }115 112 116 113 if ($this->current_language = $this->get_current_language()) { … … 165 162 add_filter( 'widget_display_callback', array( $this, 'widget_display_callback' ), 10, 2 ); 166 163 add_filter( 'sidebars_widgets', array( $this, 'sidebars_widgets' ) ); 167 168 169 //TODO check translate the post and the page.170 // add_filter('the_posts', array($this, 'translate_the_posts'), 10, 2);171 // add_filter('get_pages', array($this, 'translate_the_pages'), 10, 2);172 164 173 165 $this->add_options_filters();
Note: See TracChangeset
for help on using the changeset viewer.