View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001913 | OXID eShop (all versions) | 4.07. Source code, Test | public | 2010-06-15 15:46 | 2012-12-10 13:45 |
Reporter | csimon | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Product Version | 4.3.2 revision 27884 | ||||
Summary | 0001913: "getPictureUrl" returns null if 0 is given as argument | ||||
Description | If you pass a zero (0) as argument to the function, it returns 0. This is not correct, because folder "0" exists and contains thumbnails. | ||||
Additional Information | Solution: /** * Returns article picture * * @param int $iIndex picture index * * @return string */ public function getPictureUrl( $iIndex = '' ) { if ( $iIndex ) { if ( !$this->_hasGeneratedImage( $iIndex ) ) { $this->_generateImages( $iIndex ); } $sPic = $iIndex . "/" . $this->_getPictureName( $iIndex ); return $this->getConfig()->getPictureUrl( $sPic, $this->isAdmin() ); } } The if statement should check with the "===" operator for value "''". In addition, i would suggest to change the default value to null, instead of an empty string and check with === for null. Btw.: The "@param" doc comment says the parameter is of type int, but the standard value of "$iIndex" is string, as it is "''". | ||||
Tags | No tags attached. | ||||
Theme | |||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||