[pLog-svn] r6248 - plog/branches/lifetype-1.2/class/gallery/dao
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Fri Mar 21 12:50:59 EDT 2008
Author: jondaley
Date: 2008-03-21 12:50:58 -0400 (Fri, 21 Mar 2008)
New Revision: 6248
Modified:
plog/branches/lifetype-1.2/class/gallery/dao/galleryresource.class.php
Log:
fixes #1464, where if the extension is capitalized AND the preview format is different from the original image, the filename would not be correct
Modified: plog/branches/lifetype-1.2/class/gallery/dao/galleryresource.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/gallery/dao/galleryresource.class.php 2008-03-21 11:43:29 UTC (rev 6247)
+++ plog/branches/lifetype-1.2/class/gallery/dao/galleryresource.class.php 2008-03-21 16:50:58 UTC (rev 6248)
@@ -406,7 +406,9 @@
if( $this->getThumbnailFormat() == THUMBNAIL_OUTPUT_FORMAT_SAME_AS_IMAGE )
$previewFile = $fileName;
else {
- $previewFile = str_replace( ".".strtolower($this->getFileExtension()), ".".strtolower($this->getThumbnailFormat()), $fileName );
+ $previewFile = preg_replace("/\.".$this->getFileExtension()."/i",
+ ".".strtolower($this->getThumbnailFormat()),
+ $fileName);
}
return $previewFile;
@@ -451,8 +453,11 @@
// change the file extension, if the thumbnail output format is different from the original file
if( $this->getThumbnailFormat() == THUMBNAIL_OUTPUT_FORMAT_SAME_AS_IMAGE )
$previewFile = $fileName;
- else
- $previewFile = str_replace( ".".strtolower($this->getFileExtension()), ".".strtolower($this->getThumbnailFormat()), $fileName );
+ else{
+ $previewFile = preg_replace("/\.".$this->getFileExtension()."/i",
+ ".".strtolower($this->getThumbnailFormat()),
+ $fileName);
+ }
return $previewFile;
}
More information about the pLog-svn
mailing list