Quote:
Originally Posted by nevets1219
EDIT: Not being all that familiar with regular expressions. Let's say I moved it into a sub-directory.
From /usr/home/xcart/
To /usr/home/xcart/upgraded/
I should have:
$pattern = "\/xcart";
$replace = "/xcart/upgraded";
Is that assumption correct?
|
Yes, you are correct. /xcart would become /xcart/upgraded. Of course this will append both leading and trailing content as well.
If your not too familiar with regular expressions:
http://weitz.de/regex-coach/
You also correct in assuming x-cart does a string compare for the full path, within the func_get_thumbnail_url function in include/func.php using $xcart_dir. (4.0.x)
Code:
$cmpfunc = (X_DEF_OS_WINDOWS ? 'strncasecmp' : 'strncmp');
...
Code:
if (X_DEF_OS_WINDOWS) {
$thumbnail_info['image_path'] = str_replace('/', '\\', $thumbnail_info['image_path']);
}
if (!$cmpfunc($xcart_dir, $thumbnail_info["image_path"], strlen($xcart_dir))) {
# image_path is an locally placed image
$url = $current_location.str_replace("\\", "/", substr($thumbnail_info["image_path"], strlen($xcart_dir)));
return $url;