diff options
author | Moshe Doron <momo@php.net> | 2003-03-31 18:56:41 +0000 |
---|---|---|
committer | Moshe Doron <momo@php.net> | 2003-03-31 18:56:41 +0000 |
commit | dc8daad70d53b7137e9a0a0bc2e27202fbca5b27 (patch) | |
tree | f94f5f7aa8c6da055ab937f450f91d0028f7b19e | |
parent | 16dae2eba0f8d08225d5af693624a5dd4fb320f1 (diff) | |
download | php-git-dc8daad70d53b7137e9a0a0bc2e27202fbca5b27.tar.gz |
fix for 22904
@ now addslashes() do it also on cybase magic mode(moshe).
-rw-r--r-- | ext/standard/string.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 1f367e08dc..132118661d 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2331,13 +2331,18 @@ PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC) l--; } *s++ = *t++; - } else if (*t == '\\' && l > 0 && t[1] == '0') { + } else if (*t == '\\' && l > 0) { + if(t[1] == '0') { *s++='\0'; - t += 2; - if (len != NULL) { - (*len)--; - } - l--; + t++; + } else { + *s++=*(++t); + } + t++; + if (len != NULL) { + (*len)--; + } + l--; } else { *s++ = *t++; } @@ -2628,6 +2633,10 @@ PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_f *target++ = '\''; *target++ = '\''; break; + case '\\': + *target++ = '\\'; + *target++ = '\\'; + break; default: *target++ = *source; break; |