#1230: AgaviStringValidator issues
--------------------------------------+-------------------------------------
 Reporter:  hzilla <h...@…>           |       Owner:  dominik
     Type:  defect                    |      Status:  new    
 Priority:  normal                    |   Milestone:  1.0.3  
Component:  validation                |     Version:  1.0.2  
 Severity:  normal                    |    Keywords:         
Has_patch:  0                         |  
--------------------------------------+-------------------------------------
 A number of issues with this validator.

 1. Trimming doesn't seem to work. $utf8 switch is true by default causing
 unicode preg_match pattern to be applied which doesn't seem to match on
 test data.

 {{{
 preg_match('/^\p{Z}*(?P<trimmed>.*?)\p{Z}*$/Du', "   test    \r\n",
 $matches); // no match
 preg_match('/^\s*(?P<trimmed>.*?)\s*$/D', "   test    \r\n", $matches); //
 'test'
 preg_match('/^\p{Z}*(?P<trimmed>.*?)\p{Z}*$/Du', "   やっばい    \r\n",
 $matches); // no match
 preg_match('/^\s*(?P<trimmed>.*?)\s*$/D', "   やっばい    \r\n", $matches); //
 'やっばい'
 }}}


 2. Posted data coming in is urlencoded so line-breaks are converted to
 %0A. This would pass the trimmer. However, i'm getting this input into the
 validator as an html entity &#10; which also would pass the trimmer.

 3. Finally, the $originalValue is exported and not the new $value.

-- 
Ticket URL: <http://trac.agavi.org/ticket/1230>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5



_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets

Reply via email to