CVS update: php3/functions
| From: | shane | Date: | Tue, 01 Sep 1998 21:34:05 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-726@lists.php.net to get a copy of this message | ||
Date: Tuesday September 1, 1998 @ 17:34
Author: shane
Update of /repository/php3/functions
In directory asf:/u2/tmp/cvs-serv29361/functions
Modified Files:
file.c
Log Message:
fix meta tag get error
Index: php3/functions/file.c
diff -c php3/functions/file.c:1.177 php3/functions/file.c:1.178
*** php3/functions/file.c:1.177 Tue Sep 1 15:40:49 1998
--- php3/functions/file.c Tue Sep 1 17:34:04 1998
***************
*** 26,32 ****
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
! /* $Id: file.c,v 1.177 1998/09/01 19:40:49 shane Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
--- 26,32 ----
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
! /* $Id: file.c,v 1.178 1998/09/01 21:34:04 shane Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
***************
*** 221,228 ****
char buf[8192];
register int i=0;
int use_include_path = 0;
-
int issock=0, socketd=0;
TLS_VARS;
/* check args */
--- 221,229 ----
char buf[8192];
register int i=0;
int use_include_path = 0;
int issock=0, socketd=0;
+ int len,var_namelen;
+ char var_name[50],*val,*tmp,*end,*slashed;
TLS_VARS;
/* check args */
***************
*** 253,278 ****
RETURN_FALSE;
}
- /* Initialize return array */
- if (array_init(return_value) == FAILURE) {
- RETURN_FALSE;
- }
-
/* Now loop through the file and do the magic quotes thing if needed */
memset(buf,0,8191);
while((issock?SOCK_FGETS(buf,8191,socketd):(int)fgets(buf,8191,fp))
&& !strstr(buf,"</head>") &&
!strstr(buf,"</HEAD>")) {
if(strstr(buf,"<meta")||strstr(buf,"<META")) {
- pval entry;
- int len,var_namelen;
- char var_name[50],*var,*tmp,*end;
/* get the variable name from the name attribute of the meta tag */
tmp=strstr(buf,"name=\"");
! if(tmp){
tmp+=6;
end=strstr(tmp,"\"");
! if(end){
unsigned char *c;
*end='\0';
snprintf(var_name,50,"meta_%s",tmp);
--- 254,272 ----
RETURN_FALSE;
}
/* Now loop through the file and do the magic quotes thing if needed */
memset(buf,0,8191);
while((issock?SOCK_FGETS(buf,8191,socketd):(int)fgets(buf,8191,fp))
&& !strstr(buf,"</head>") &&
!strstr(buf,"</HEAD>")) {
if(strstr(buf,"<meta")||strstr(buf,"<META")) {
+ memset(var_name,0,50);
/* get the variable name from the name attribute of the meta tag */
tmp=strstr(buf,"name=\"");
! if(tmp) {
tmp+=6;
end=strstr(tmp,"\"");
! if(end) {
unsigned char *c;
*end='\0';
snprintf(var_name,50,"meta_%s",tmp);
***************
*** 309,328 ****
end=strstr(tmp,"\"");
if(end) {
*end='\0';
! var=estrdup(tmp);
*end='"';
}
}
}
! if(var) {
if (php3_ini.magic_quotes_runtime) {
! entry.value.str.val = _php3_addslashes(var,0,&len,0);
} else {
! entry.value.str.len = strlen(var);
! entry.value.str.val = var;
}
! entry.type = IS_STRING;
! _php3_hash_update(GLOBAL(active_symbol_table), var_name, var_namelen+1, (void *) &entry,
sizeof(pval),NULL);
}
}
}
--- 303,321 ----
end=strstr(tmp,"\"");
if(end) {
*end='\0';
! val=estrdup(tmp);
*end='"';
}
}
}
! if(*var_name && val) {
if (php3_ini.magic_quotes_runtime) {
! slashed = _php3_addslashes(val,0,&len,0);
} else {
! slashed = estrndup(val,strlen(val));
}
! SET_VAR_STRING(var_name,slashed);
! efree(val);
}
}
}
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net