Performance improvements using strpos. Fixes #7611 and #7610 props johnbillion.

git-svn-id: http://svn.automattic.com/wordpress/trunk@8754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2008-08-27 20:47:01 +00:00
parent 18a0bc103f
commit 00583d64eb
4 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) {
$s = $_GET['q']; // is this slashed already?
if ( strstr( $s, ',' ) ) {
if ( false !== strpos( $s, ',' ) ) {
$s = explode( ',', $s );
$s = $s[count( $s ) - 1];
}

View File

@ -1752,7 +1752,7 @@ function setup_postdata($post) {
if ( is_single() || is_page() || is_feed() )
$more = 1;
$content = $post->post_content;
if ( preg_match('/<!--nextpage-->/', $content) ) {
if ( strpos( $content, '<!--nextpage-->' ) ) {
if ( $page > 1 )
$more = 1;
$multipage = 1;

View File

@ -103,7 +103,7 @@ function retrieve_password() {
if ( empty( $_POST['user_login'] ) && empty( $_POST['user_email'] ) )
$errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.'));
if ( strstr($_POST['user_login'], '@') ) {
if ( strpos($_POST['user_login'], '@') ) {
$user_data = get_user_by_email(trim($_POST['user_login']));
if ( empty($user_data) )
$errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));

View File

@ -60,7 +60,7 @@ for ($i=1; $i <= $count; $i++) :
$content_transfer_encoding = explode(';', $content_transfer_encoding);
$content_transfer_encoding = $content_transfer_encoding[0];
}
if (($content_type == 'multipart/alternative') && (preg_match('/boundary="/', $line)) && ($boundary == '')) {
if (($content_type == 'multipart/alternative') && (false !== strpos($line, 'boundary="')) && ($boundary == '')) {
$boundary = trim($line);
$boundary = explode('"', $boundary);
$boundary = $boundary[1];