Index: branches/5.2.x/core/units/images/image_tag_processor.php =================================================================== diff -u -N -r14572 -r14585 --- branches/5.2.x/core/units/images/image_tag_processor.php (.../image_tag_processor.php) (revision 14572) +++ branches/5.2.x/core/units/images/image_tag_processor.php (.../image_tag_processor.php) (revision 14585) @@ -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 $parent_item->isField('ThumbPath') && !$image_id - ) { + ) { if (is_null($parent_item->GetDBField('SameImages'))) { // JOIN definetly failed, because it's not-null column $object->setLoaded(false); @@ -197,13 +197,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); } } @@ -275,9 +275,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; } @@ -386,9 +388,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); }