Browse Source

adding sanity checking for incoming arguments

Adar Porat 12 years ago
parent
commit
a7c5b98bea
1 changed files with 5 additions and 0 deletions
  1. 5 0
      library/Zend/Filter/File/Rename.php

+ 5 - 0
library/Zend/Filter/File/Rename.php

@@ -142,6 +142,11 @@ class Zend_Filter_File_Rename implements Zend_Filter_Interface
     public function getNewName($value, $source = false)
     public function getNewName($value, $source = false)
     {
     {
         $file = $this->_getFileName($value);
         $file = $this->_getFileName($value);
+        
+        if (!is_array($file) || !array_key_exists('source', $file) || !array_key_exists('target', $file)) {
+            return $value;
+        }
+        
         if ($file['source'] == $file['target']) {
         if ($file['source'] == $file['target']) {
             return $value;
             return $value;
         }
         }