Index: branches/5.1.x/core/units/images/image_tag_processor.php =================================================================== diff -u -N -r14241 -r14477 --- branches/5.1.x/core/units/images/image_tag_processor.php (.../image_tag_processor.php) (revision 14241) +++ branches/5.1.x/core/units/images/image_tag_processor.php (.../image_tag_processor.php) (revision 14477) @@ -1,6 +1,6 @@ SelectParam($params, 'name,Name'); $image_field = $this->SelectParam($params, 'field,Field'); // ie. virtual names PrimaryImage, Image1, Image2 $image_id = $this->Application->GetVar($this->Prefix.'_id'); - + if ( // is primary, when primary mark set OR name & field not given ($is_primary || !($image_name || $image_field)) && // primary image is preloaded AND direct id not given isset($parent_item->Fields['ThumbPath']) && !$image_id - ) { + ) { $object->SetDefaultValues(); if (is_null($parent_item->GetDBField('SameImages'))) { @@ -199,13 +199,13 @@ function makeRelativePaths(&$object) { $thumb_path = $object->GetDBField('ThumbPath'); - if ($thumb_path && substr($thumb_path, 0, 1) != '/') { - $object->SetDBField('ThumbPath', '/'.$thumb_path); + if ($thumb_path && substr($thumb_path, 0, 1) != DIRECTORY_SEPARATOR) { + $object->SetDBField('ThumbPath', DIRECTORY_SEPARATOR . $thumb_path); } $local_path = $object->GetDBField('LocalPath'); - if ($local_path && substr($local_path, 0, 1) != '/') { - $object->SetDBField('LocalPath', '/'.$local_path); + if ($local_path && substr($local_path, 0, 1) != DIRECTORY_SEPARATOR) { + $object->SetDBField('LocalPath', DIRECTORY_SEPARATOR . $local_path); } } @@ -277,9 +277,11 @@ return false; } - $base_url = rtrim($this->Application->BaseURL(), '/'); - $dst_image = preg_replace('/^' . preg_quote($base_url, '/') . '/', FULL_PATH, $src_image, 1); + $file_helper =& $this->Application->recallObject('FileHelper'); + /* @var $file_helper FileHelper */ + $dst_image = $file_helper->urlToPath($src_image); + return $dst_image != $src_image ? $dst_image : false; } @@ -388,9 +390,9 @@ return $file_helper->urlToPath($path); } - // TODO: change to urlToPath usage later + // TODO: change to urlToPath usage later // relative url (we add sort of does - + return FULL_PATH . '/' . mb_substr(THEMES_PATH, 1) . '/' . rawurldecode($path); }