mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
Fix RINIT/RSHUTDOWN functions and add url_adapt_ext()
This commit is contained in:
parent
cfa034a07a
commit
e986a4b0a3
2 changed files with 14 additions and 0 deletions
|
@ -37,10 +37,12 @@
|
|||
|
||||
PHP_RINIT_FUNCTION(url_scanner) {
|
||||
url_adapt(NULL,0,NULL,NULL);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_RSHUTDOWN_FUNCTION(url_scanner) {
|
||||
url_adapt(NULL,0,NULL,NULL);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@ -81,6 +83,15 @@ static char *url_attr_addon(const char *tag,const char *attr,const char *val,con
|
|||
|
||||
#define US BG(url_adapt_state)
|
||||
|
||||
char *url_adapt_ext(const char *src, size_t srclen, const char *name, const char *val, size_t *newlen)
|
||||
{
|
||||
char buf[1024];
|
||||
|
||||
snprintf(buf, sizeof(buf)-1, "%s=%s", name, val);
|
||||
|
||||
return url_adapt(src, srclen, buf, newlen);
|
||||
}
|
||||
|
||||
char *url_adapt(const char *src, size_t srclen, const char *data, size_t *newlen)
|
||||
{
|
||||
char *out,*outp;
|
||||
|
|
|
@ -20,6 +20,9 @@
|
|||
#ifndef URI_SCANNER_H
|
||||
#define URI_SCANNER_H
|
||||
|
||||
PHP_RINIT_FUNCTION(url_scanner);
|
||||
PHP_RSHUTDOWN_FUNCTION(url_scanner);
|
||||
|
||||
char *url_adapt(const char *src, size_t srclen, const char *data, size_t *newlen);
|
||||
|
||||
enum url_state {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue