Prechádzať zdrojové kódy

ZF-8633: check ids by pattern [a-zA-Z0-9_] in stead of [\w] and set D modifier

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@21221 44c647ce-9c0f-0410-b52a-842ac1e357ba
mabe 16 rokov pred
rodič
commit
9734a41159

+ 2 - 2
library/Zend/Cache/Backend/File.php

@@ -123,8 +123,8 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
             $this->setCacheDir(self::getTmpDir() . DIRECTORY_SEPARATOR, false);
         }
         if (isset($this->_options['file_name_prefix'])) { // particular case for this option
-            if (!preg_match('~^[\w]+$~', $this->_options['file_name_prefix'])) {
-                Zend_Cache::throwException('Invalid file_name_prefix : must use only [a-zA-A0-9_]');
+            if (!preg_match('~^[a-zA-Z0-9_]+$~D', $this->_options['file_name_prefix'])) {
+                Zend_Cache::throwException('Invalid file_name_prefix : must use only [a-zA-Z0-9_]');
             }
         }
         if ($this->_options['metadatas_array_max_size'] < 10) {

+ 1 - 1
library/Zend/Cache/Core.php

@@ -624,7 +624,7 @@ class Zend_Cache_Core
         if (substr($string, 0, 9) == 'internal-') {
             Zend_Cache::throwException('"internal-*" ids or tags are reserved');
         }
-        if (!preg_match('~^[\w]+$~D', $string)) {
+        if (!preg_match('~^[a-zA-Z0-9_]+$~D', $string)) {
             Zend_Cache::throwException("Invalid id or tag '$string' : must use only [a-zA-Z0-9_]");
         }
     }