Index: trunk/kernel/include/image.php =================================================================== diff -u -N -r6428 -r7867 --- trunk/kernel/include/image.php (.../image.php) (revision 6428) +++ trunk/kernel/include/image.php (.../image.php) (revision 7867) @@ -482,77 +482,40 @@ return $this->ThumbURL(); } - if(strlen($this->Get("Url"))) - return $this->Get("Url"); - if($this->Get("LocalImage")=="1") - { - $url = $this->Get("LocalPath"); - //$url = $this->GetImageDir().$this->GetFileName(); - if(file_exists($pathtoroot.$url)) - { - if(strlen($url)) - { - $url = $rootURL.$url; - return $url; - } - else - { - if(strlen($Default)) - $url = $rootURL.$Default; - return $url; - } - } - else - { - if(strlen($Default)) - { - return $rootURL.$Default; - } - else - return ""; - } + if(strlen($this->Get('Url'))) { + return $this->Get('Url'); } - else - { - if(strlen($Default)) - { - return $rootURL.$Default; + + if ($this->Get('LocalImage') == 1) { + $url = $this->Get('LocalPath'); + $file_found = file_exists($pathtoroot.$url) ? true : constOn('DBG_IMAGE_RECOVERY'); + + if ($url && $file_found) { + return $rootURL.$url; } - else - return ""; } + + return $rootURL.$Default; } function ThumbURL() { - global $rootURL, $pathtoroot, $objConfig; + global $rootURL, $pathtoroot; - if(strlen($this->Get("ThumbUrl"))) - { - return $this->Get("ThumbUrl"); + if (strlen($this->Get('ThumbUrl'))) { + // image on external site + return $this->Get('ThumbUrl'); } - - if($this->Get("LocalThumb")=="1") - { - $url = $this->Get("ThumbPath"); - //$url = $this->GetImageDir().$this->GetFileName(); - if(file_exists($pathtoroot.$url)) - { - if(strlen($url)) - { - $url = $rootURL.$url; - } - else - $url = $rootURL."kernel/images/noimage.gif"; - return $url; + + if ($this->Get('LocalThumb') == 1) { + $url = $this->Get('ThumbPath'); + $file_found = file_exists($pathtoroot.$url) ? true : constOn('DBG_IMAGE_RECOVERY'); + if ($url && $file_found) { + return $rootURL.$url; } - else - return $rootURL."kernel/images/noimage.gif"; } - else - { - return $rootURL."kernel/images/noimage.gif"; - } + + return $rootURL.'kernel/images/noimage.gif'; } function ParseObject($element)