]> git.pld-linux.org Git - packages/php-pear-HTTP_Upload.git/commitdiff
- case insensitive extension check
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 6 Jun 2005 14:04:12 +0000 (14:04 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    php-pear-HTTP_Upload-bug-4318.patch -> 1.1

php-pear-HTTP_Upload-bug-4318.patch [new file with mode: 0644]

diff --git a/php-pear-HTTP_Upload-bug-4318.patch b/php-pear-HTTP_Upload-bug-4318.patch
new file mode 100644 (file)
index 0000000..2ac8123
--- /dev/null
@@ -0,0 +1,45 @@
+--- ./Upload.php~      2005-06-06 16:52:38.000000000 +0300
++++ ./Upload.php       2005-06-06 17:02:12.000000000 +0300
+@@ -836,12 +836,14 @@
+      *                       1) 'deny'   Will deny only the supplied extensions
+      *                       2) 'accept' Will accept only the supplied extensions
+      *                                   as valid
++     * @param bool $case_sensitive Is extension check is case sensitive.
+      * @access public
+      */
+-    function setValidExtensions($exts, $mode = 'deny')
++    function setValidExtensions($exts, $mode = 'deny', $case_sensitive = true)
+     {
+         $this->_extensions_check = $exts;
+         $this->_extensions_mode  = $mode;
++        $this->_extensions_case_sensitive  = $case_sensitive;
+     }
+     /**
+@@ -854,17 +856,22 @@
+     {
+         $exts = $this->_extensions_check;
+         settype($exts, 'array');
++        $ext = $this->getProp('ext');
++        if (!$this->_extensions_case_sensitive) {
++            $ext = strtolower($ext);
++        }
++
+         if ($this->_extensions_mode == 'deny') {
+-            if (in_array($this->getProp('ext'), $exts)) {
++            if (in_array($ext, $exts)) {
+                 return false;
+             }
+         // mode == 'accept'
+         } else {
+-            if (!in_array($this->getProp('ext'), $exts)) {
++            if (!in_array($ext, $exts)) {
+                 return false;
+             }
+         }
+         return true;
+     }
+ }
+-?>
+\ No newline at end of file
++?>
This page took 0.097209 seconds and 4 git commands to generate.