View Single Post
  #15  
Old 08-01-2014, 01:11 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Why is X-Cart 5 so unstable?

Sorry for it, guys, this is a bug. The hotfix for it is below:

Code:
diff --git a/src/classes/XLite/Core/LessParser.php b/src/classes/XLite/Core/LessParser.php index f29aeee..1cdeb0e 100644 --- a/src/classes/XLite/Core/LessParser.php +++ b/src/classes/XLite/Core/LessParser.php @@ -259,7 +259,7 @@ class LessParser extends \XLite\Base\Singleton $url = stripslashes(substr($url, 1, -1)); } - $url = \Includes\Utils\FileManager::makeRelativePath($file, LC_DIR_ROOT . substr($url, strlen($rootURL))); + $url = str_replace(LC_DS, '/', \Includes\Utils\FileManager::makeRelativePath($file, LC_DIR_ROOT . substr($url, strlen($rootURL)))); if (preg_match('/[\'"]/Ss', $url)) { $url = '"' . addslashes($url) . '"'; -- diff --git a/src/Includes/Utils/FileManager.php b/src/Includes/Utils/FileManager.php index 707fe54..0efec9c 100644 --- a/src/Includes/Utils/FileManager.php +++ b/src/Includes/Utils/FileManager.php @@ -594,8 +594,6 @@ abstract class FileManager extends \Includes\Utils\AUtils } while ($from === $to && !empty($absFromPath) && !empty($absToPath)); return str_repeat('..' . LC_DS, count($absFromPath)) - . $to - . LC_DS - . implode(LC_DS, $absToPath); + . $to . (!empty($absToPath) ? (LC_DS . implode(LC_DS, $absToPath)) : ''); } } diff --git a/src/classes/XLite/Core/LessParser.php b/src/classes/XLite/Core/LessParser.php index 1cdeb0e..97f2b28 100644 --- a/src/classes/XLite/Core/LessParser.php +++ b/src/classes/XLite/Core/LessParser.php @@ -261,11 +261,7 @@ class LessParser extends \XLite\Base\Singleton $url = str_replace(LC_DS, '/', \Includes\Utils\FileManager::makeRelativePath($file, LC_DIR_ROOT . substr($url, strlen($rootURL)))); - if (preg_match('/[\'"]/Ss', $url)) { - $url = '"' . addslashes($url) . '"'; - } - - return 'url(' . $url . ')'; + return 'url("' . $url . '")'; } /** ---

You can safely apply it to the core files, because this fix will be already included into 5.1.5.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote