Author: caefer
Date: 2010-04-14 04:44:14 +0200 (Wed, 14 Apr 2010)
New Revision: 29133

Modified:
   
plugins/sfImageTransformExtraPlugin/trunk/lib/transforms/sfImageTransformManager.class.php
Log:
optimised the extension matching and file info code

Modified: 
plugins/sfImageTransformExtraPlugin/trunk/lib/transforms/sfImageTransformManager.class.php
===================================================================
--- 
plugins/sfImageTransformExtraPlugin/trunk/lib/transforms/sfImageTransformManager.class.php
  2010-04-14 02:20:52 UTC (rev 29132)
+++ 
plugins/sfImageTransformExtraPlugin/trunk/lib/transforms/sfImageTransformManager.class.php
  2010-04-14 02:44:14 UTC (rev 29133)
@@ -106,10 +106,11 @@
   {
     foreach($parameters as $key => $parameter)
     {
-      if(in_array(strtolower(substr($parameter, -4)), array('.jpg', '.gif', 
'.png')))
+      $pathinfo = strtolower(pathinfo($parameter));
+      if(in_array($pathinfo['extension'], array('jpg', 'jpeg', 'gif', 'png')))
       {
-        $filepath = dirname($parameter);
-        $filename = basename($parameter);
+        $filepath = $pathinfo['dirname'];
+        $filename = $pathinfo['basename'];
 
         $pluginDirs = ProjectConfiguration::getActive()->getAllPluginPaths();
         $pluginDir = $pluginDirs['sfImageTransformExtraPlugin'];

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to