Index: trunk/kernel/units/images/image_tag_processor.php =================================================================== diff -u -N -r8705 -r8771 --- trunk/kernel/units/images/image_tag_processor.php (.../image_tag_processor.php) (revision 8705) +++ trunk/kernel/units/images/image_tag_processor.php (.../image_tag_processor.php) (revision 8771) @@ -145,11 +145,31 @@ return $ret; } + /** + * Appends "/" to beginning of image path (in case when missing) + * + * @param kDBItem $object + * @todo old in-portal doesn't append first slash, but we do => append first slash for him :) + */ + function makeRelativePaths(&$object) + { + $thumb_path = $object->GetDBField('ThumbPath'); + if ($thumb_path && substr($thumb_path, 0, 1) != '/') { + $object->SetDBField('ThumbPath', '/'.$thumb_path); + } + + $local_path = $object->GetDBField('LocalPath'); + if ($local_path && substr($local_path, 0, 1) != '/') { + $object->SetDBField('LocalPath', '/'.$local_path); + } + } + function ImageSrc($params) { $object =& $this->getObject($params); - $base_url = rtrim($this->Application->BaseURL(), '/'); + $this->makeRelativePaths($object); + $base_url = rtrim($this->Application->BaseURL(), '/'); if ($object->GetDBField('SameImages') && $object->GetDBField('ThumbPath')) { // we can auto-resize image, when source image available & we use same image for thumbnail & full image in admin