From 2a475e119008b83cd23d9c16f471ea114aa04e8b Mon Sep 17 00:00:00 2001 From: vChabot Date: Thu, 22 Dec 2011 16:18:27 +0000 Subject: [PATCH] // fix htaccess generation --- classes/Dispatcher.php | 4 ++-- classes/Tools.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/classes/Dispatcher.php b/classes/Dispatcher.php index 8cde151fb..1bdc1c15f 100644 --- a/classes/Dispatcher.php +++ b/classes/Dispatcher.php @@ -492,9 +492,9 @@ class DispatcherCore $replace = $route['keywords'][$key]['prepend'].$params[$key].$route['keywords'][$key]['append']; else $replace = ''; - $url = preg_replace('#(*UTF8)\{([^{}]+:)?'.$key.'(:[^{}])?\}#', $replace, $url); + $url = preg_replace('#\{([^{}]+:)?'.$key.'(:[^{}])?\}#', $replace, $url); } - $url = preg_replace('#(*UTF8)\{([^{}]+:)?[a-z0-9_]+?(:[^{}])?\}#', '', $url); + $url = preg_replace('#\{([^{}]+:)?[a-z0-9_]+?(:[^{}])?\}#', '', $url); } // Build a classic url index.php?controller=foo&... else diff --git a/classes/Tools.php b/classes/Tools.php index b3bcde0b1..019e4d353 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -1563,8 +1563,8 @@ class ToolsCore fwrite($write_fd, "# Images\n"); if (Configuration::get('PS_LEGACY_IMAGES')) { - fwrite($write_fd, 'RewriteRule (*UTF8)^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.'$1-$2$3.jpg [L]'."\n"); - fwrite($write_fd, 'RewriteRule (*UTF8)^([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.'$1-$2.jpg [L]'."\n"); + fwrite($write_fd, 'RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.'$1-$2$3.jpg [L]'."\n"); + fwrite($write_fd, 'RewriteRule ^([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.'$1-$2.jpg [L]'."\n"); } // Rewrite product images < 100 millions @@ -1577,10 +1577,10 @@ class ToolsCore $img_name .= '$'.$j; } $img_name .= '$'.$j; - fwrite($write_fd, 'RewriteRule (*UTF8)^'.str_repeat('([0-9])', $i).'(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.$img_path.$img_name.".jpg [L]\n"); + fwrite($write_fd, 'RewriteRule ^'.str_repeat('([0-9])', $i).'(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-\pL]*\.jpg$ '._PS_PROD_IMG_.$img_path.$img_name.".jpg [L]\n"); } - fwrite($write_fd, 'RewriteRule (*UTF8)^c/([0-9]+)(\-[_a-zA-Z0-9-\pL]*)/[_a-zA-Z0-9-]*\.jpg$ img/c/$1$2.jpg [L]'."\n"); - fwrite($write_fd, 'RewriteRule (*UTF8)^c/([a-zA-Z-]+)/[a-zA-Z0-9-\pL]+\.jpg$ img/c/$1.jpg [L]'."\n"); + fwrite($write_fd, 'RewriteRule ^c/([0-9]+)(\-[_a-zA-Z0-9-\pL]*)/[_a-zA-Z0-9-]*\.jpg$ img/c/$1$2.jpg [L]'."\n"); + fwrite($write_fd, 'RewriteRule ^c/([a-zA-Z-]+)/[a-zA-Z0-9-\pL]+\.jpg$ img/c/$1.jpg [L]'."\n"); } // Redirections to dispatcher