View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001557 | OXID eShop (all versions) | 4.07. Source code, Test | public | 2009-12-14 06:58 | 2012-12-10 13:45 |
Reporter | avenger | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Fixed in Version | 4.3.0 revision 26948 | ||||
Summary | 0001557: Wrong handling of "no picture" situation in "getPictureUrl()" | ||||
Description | The "public function getPictureUrl(..." in "core/oxconfig.php" returns wrong "nopic"-information, in case the picture defined is not found. Code: //anything is better than empty name, because <img src=""> calls shop once more = x2 SLOW. if (!$sUrl) { return $this->getTemplateUrl()."../".$this->_sPictureDir."/0/nopic.jpg"; } "$this->getTemplateUrl()."../".$this->_sPictureDir."/0/nopic.jpg";" e.g. yields something like: Code: "...../out/powertemplate/tpl/../pictures/0/nopic.jpg" which, of course, is not the valid picture path.... The valid picture path ought to be Code: "...../out/pictures/0/nopic.jpg" instead... Also, the routine always returns the "nopic" in thumbnail size, regardless of the picture size requested (e.g. "icon"). The following code will ensure, that a.) the valid picture path is returned and b.) the proper 'nopic.jpg' is returned from the same directory as the picture requested. Code: if (!$sUrl) { $sPicPath=explode('/',$sFile); $sPicPath[sizeof($sPicPath)-1]='nopic.jpg'; $sPicPath=implode('/',$sPicPath); return $this->getOutUrl().$this->_sPictureDir.'/'.$sPicPath; } Another problem in that context: If it was once concluded in "getPictureUrl()", that a picture was not availble, it will not help, if you upload the missing picture.... Instead, the "missing picture" info will always be directly supplied from the cache. | ||||
Tags | No tags attached. | ||||
Theme | |||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
|
Fixed code line looks like: if (!$sUrl) { $sUrl = $this->getUrl( "0/nopic.jpg", $this->_sPictureDir, $blAdmin, $blSSL, $blNativeImg, $iLang, $iShopId ); } "oxConfig::getPictureUrl()" is not intended to handle special cases, just assures that non existing image url is not returned. So i did not add additional logics for checking image type. |
|
fixed |