From 000eaf4a5aa8dee0051a93ad2f40a125695055b7 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Thu, 28 Mar 2002 07:48:50 +0000 Subject: [PATCH] - MFH for bug 16314 --- ext/standard/string.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index 110dcad657..f68158dd77 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2120,10 +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; } else { @@ -2131,6 +2127,26 @@ 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 */ -- 2.50.1