From 33d82cb6d1dc8e1fc1a0e2e93c0a9a21cb55b46d Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Sat, 11 Dec 1999 19:51:04 +0000 Subject: get_meta_tags() was using php_stristr() so it needed to be changed. Optimized it to use php_memnstr() directly. --- ext/standard/file.c | 17 ++++++++++++----- ext/standard/php_string.h | 3 ++- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'ext/standard') diff --git a/ext/standard/file.c b/ext/standard/file.c index df2c2af36a..60e0b30d9a 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -386,6 +386,7 @@ PHP_FUNCTION(get_meta_tags) pval **filename, **arg2; FILE *fp; char buf[8192]; + char buf_lcase[8192]; int use_include_path = 0; int issock=0, socketd=0; int len, var_namelen; @@ -432,14 +433,19 @@ PHP_FUNCTION(get_meta_tags) } /* Now loop through the file and do the magic quotes thing if needed */ memset(buf, 0, 8191); - while((FP_FGETS(buf,8191,socketd,fp,issock) != NULL) - && !php_stristr(buf,"")) { - if(php_stristr(buf,"", sizeof("")-1, buf_lcase + 8191)) + break; + + if(php_memnstr(buf_lcase, "