Changeset 3264469
- Timestamp:
- 03/31/2025 01:18:42 PM (12 months ago)
- Location:
- seur/trunk
- Files:
-
- 3 edited
-
core/functions/functions.php (modified) (3 diffs)
-
loader.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
seur/trunk/core/functions/functions.php
r3261412 r3264469 646 646 } 647 647 648 function str_ends_with_php7($haystack, $needle) { 649 $length = strlen($needle); 650 return $length > 0 ? substr($haystack, -$length) === $needle : false; 651 } 652 648 653 function matchPostcode($postcode, $rules) { 649 654 $rules = explode("\n", $rules); // Separar líneas en un array … … 652 657 $rule = trim($rule); 653 658 659 if ($rule == '*') { 660 return true; 661 } 662 654 663 // Comprobación por prefijo (ejemplo: 00*) 655 if (str_ends_with ($rule, '*')) {664 if (str_ends_with_php7($rule, '*')) { 656 665 $prefix = rtrim($rule, '*'); 657 if ( strpos($postcode, $prefix) === 0) {666 if ($prefix && strpos($postcode, $prefix) === 0) { 658 667 return true; // Coincidencia con prefijo 659 668 } … … 1128 1137 function seur_clean_data( $out ) { 1129 1138 1130 $out = str_replace( 'Á', 'A', $out ); 1131 $out = str_replace( 'À', 'A', $out ); 1132 $out = str_replace( 'Ä', 'A', $out ); 1133 $out = str_replace( 'É', 'E', $out ); 1134 $out = str_replace( 'È', 'E', $out ); 1135 $out = str_replace( 'Ë', 'E', $out ); 1136 $out = str_replace( 'Í', 'I', $out ); 1137 $out = str_replace( 'Ì', 'I', $out ); 1138 $out = str_replace( 'Ï', 'I', $out ); 1139 $out = str_replace( 'Ó', 'O', $out ); 1140 $out = str_replace( 'Ò', 'O', $out ); 1141 $out = str_replace( 'Ö', 'O', $out ); 1142 $out = str_replace( 'Ú', 'U', $out ); 1143 $out = str_replace( 'Ù', 'U', $out ); 1144 $out = str_replace( 'Ü', 'U', $out ); 1145 $out = str_replace( '&', '-', $out ); 1146 $out = str_replace( '<', ' ', $out ); 1147 $out = str_replace( '>', ' ', $out ); 1148 $out = str_replace( '/', ' ', $out ); 1149 $out = str_replace( '"', ' ', $out ); 1150 $out = str_replace( "'", ' ', $out ); 1151 $out = str_replace( '"', ' ', $out ); 1152 $out = str_replace( '?', ' ', $out ); 1153 $out = str_replace( '¿', ' ', $out ); 1154 1155 return $out; 1139 // Detecta y convierte a UTF-8 si es necesario 1140 $encoding = mb_detect_encoding($out, ["UTF-8", "ISO-8859-1", "Windows-1252"], true); 1141 if ($encoding !== "UTF-8") { 1142 $out = mb_convert_encoding($out, "UTF-8", $encoding); 1143 } 1144 1145 // Normaliza los caracteres especiales para evitar errores de codificación 1146 $out = iconv('UTF-8', 'ASCII//TRANSLIT', $out); 1147 1148 // Sustituciones de caracteres específicos 1149 $out = str_replace(['Á', 'À', 'Ä'], 'A', $out); 1150 $out = str_replace(['É', 'È', 'Ë'], 'E', $out); 1151 $out = str_replace(['Í', 'Ì', 'Ï'], 'I', $out); 1152 $out = str_replace(['Ó', 'Ò', 'Ö'], 'O', $out); 1153 $out = str_replace(['Ú', 'Ù', 'Ü'], 'U', $out); 1154 $out = str_replace(['á', 'à', 'ä'], 'a', $out); 1155 $out = str_replace(['é', 'è', 'ë'], 'e', $out); 1156 $out = str_replace(['í', 'ì', 'ï'], 'i', $out); 1157 $out = str_replace(['ó', 'ò', 'ö'], 'o', $out); 1158 $out = str_replace(['ú', 'ù', 'ü'], 'u', $out); 1159 $out = str_replace(['&', '<', '>', '/', '"', "'", '?', '¿'], ' ', $out); 1160 1161 return trim($out); 1156 1162 } 1157 1163 -
seur/trunk/loader.php
r3261412 r3264469 4 4 * Plugin URI: http://www.seur.com/ 5 5 * Description: Add SEUR shipping method to WooCommerce. The SEUR plugin for WooCommerce allows you to manage your order dispatches in a fast and easy way 6 * Version: 2.2.2 26 * Version: 2.2.23 7 7 * Author: SEUR Oficial 8 8 * Author URI: http://www.seur.com/ 9 * Tested up to: 6. 6.29 * Tested up to: 6.7.2 10 10 * WC requires at least: 3.0 11 11 * WC tested up to: 9.1.4 … … 20 20 use Automattic\WooCommerce\Utilities\FeaturesUtil; 21 21 22 define( 'SEUR_OFFICIAL_VERSION', '2.2.2 2' );22 define( 'SEUR_OFFICIAL_VERSION', '2.2.23' ); 23 23 define( 'SEUR_DB_VERSION', '1.0.5' ); 24 24 define( 'SEUR_TABLE_VERSION', '1.0.5' ); -
seur/trunk/readme.txt
r3261412 r3264469 3 3 Tags: woocommerce, shipping, seur, logistica, enviar paquete 4 4 Requires at least: 4.0 5 Tested up to: 6. 6.26 Stable tag: 2.2.2 25 Tested up to: 6.7.2 6 Stable tag: 2.2.23 7 7 WC requires at least: 3.0 8 8 WC tested up to: 9.1.4 … … 93 93 94 94 == Changelog == 95 96 == 2.2.23 == 97 98 * FIXED: Clean special chars and force utf8 codification 99 * FIXED: Fix php7 compatibility 95 100 96 101 == 2.2.22 ==
Note: See TracChangeset
for help on using the changeset viewer.