Browse Source

[ZF-7902] Zend_Filter:

- fixed char problem on Zend_Filter_StringTrim

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@18399 44c647ce-9c0f-0410-b52a-842ac1e357ba
thomas 16 years ago
parent
commit
b70c6856d3
2 changed files with 10 additions and 3 deletions
  1. 2 2
      library/Zend/Filter/StringTrim.php
  2. 8 1
      tests/Zend/Filter/StringTrimTest.php

+ 2 - 2
library/Zend/Filter/StringTrim.php

@@ -113,8 +113,8 @@ class Zend_Filter_StringTrim implements Zend_Filter_Interface
     protected function _unicodeTrim($value, $charlist = '\\\\s')
     {
         $chars = preg_replace(
-            array( '/[\^\-\]\\\]/S', '/\\\{4}/S' ),
-            array( '\\\\\\0', '\\' ),
+            array( '/[\^\-\]\\\]/S', '/\\\{4}/S', '/\//'),
+            array( '\\\\\\0', '\\', '\/' ),
             $charlist
         );
 

+ 8 - 1
tests/Zend/Filter/StringTrimTest.php

@@ -113,4 +113,11 @@ class Zend_Filter_StringTrimTest extends PHPUnit_Framework_TestCase
     {
         $this->assertEquals('Зенд', $this->_filter->filter('Зенд'));
     }
-}
+
+    /**
+     * @ZF-7902
+     */
+    public function testZF7902()
+    {
+        $this->assertEquals('/', $this->_filter->filter('/'));
+    }}