[wp-trac] [WordPress Trac] #3920: Use strpos() instead of strstr() where appropriate

WordPress Trac wp-trac at lists.automattic.com
Wed Mar 7 04:03:50 GMT 2007


#3920: Use strpos() instead of strstr() where appropriate
--------------------------+-------------------------------------------------
 Reporter:  rob1n         |       Owner:  rob1n
     Type:  defect        |      Status:  new  
 Priority:  normal        |   Milestone:  2.2  
Component:  Optimization  |     Version:  2.1.2
 Severity:  normal        |    Keywords:       
--------------------------+-------------------------------------------------
 According to the PHP manual page, strpos() is "faster and less memory
 intensive" (http://us2.php.net/strstr) than strstr() if you just want to
 know whether a string contains another string.

 After talking with Ryan, I made a patch that changes every strstr() call
 to a strpos() (*except* where appropriate for strstr()).

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3920>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list