summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
authorHartmut Holzgraefe <hholzgra@php.net>2002-03-27 20:20:57 +0000
committerHartmut Holzgraefe <hholzgra@php.net>2002-03-27 20:20:57 +0000
commit492c8372728ff682cdf23d47f4a76dde92b02b7c (patch)
tree5215a3f7fa498c7a003fca671cfb70603920bd46 /ext/standard/string.c
parent8f0390c708d5b92f20318242a1fd623f5dbce1f4 (diff)
downloadphp-git-492c8372728ff682cdf23d47f4a76dde92b02b7c.tar.gz
fix for Bug #16314
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r--ext/standard/string.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 019e29023a..fcec74a2ca 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2120,9 +2120,6 @@ PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC)
int l;
char escape_char='\\';
- if (PG(magic_quotes_sybase)) {
- escape_char='\'';
- }
if (len != NULL) {
l = *len;
@@ -2131,6 +2128,25 @@ PHPAPI void php_stripslashes(char *str, int *len TSRMLS_DC)
}
s = str;
t = str;
+
+ if (PG(magic_quotes_sybase)) {
+ while (l >= 0) {
+ if(*t=='\'') {
+ if((l>0) && (t[1]=='\'')) {
+ t++;
+ if (len != NULL)
+ (*len)--;
+ l--;
+ }
+ }
+ *s++ = *t++;
+ l--;
+ }
+ *s = '\0';
+
+ return;
+ }
+
while (l > 0) {
if (*t == escape_char) {
t++; /* skip the slash */