summaryrefslogtreecommitdiff
path: root/ext/standard/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/file.c')
-rw-r--r--ext/standard/file.c66
1 files changed, 5 insertions, 61 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 88d4062c6f..f3ad871faa 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -413,11 +413,7 @@ PHP_FUNCTION(get_meta_tags)
have_name = 1;
} else if (saw_content) {
/* Get the CONTENT attr (Single word attr, non-quoted) */
- if (PG(magic_quotes_runtime)) {
- value = php_addslashes(md.token_data, 0, &md.token_len, 0 TSRMLS_CC);
- } else {
- value = estrndup(md.token_data, md.token_len);
- }
+ value = estrndup(md.token_data, md.token_len);
have_content = 1;
}
@@ -451,11 +447,7 @@ PHP_FUNCTION(get_meta_tags)
have_name = 1;
} else if (saw_content) {
/* Get the CONTENT attr (Single word attr, non-quoted) */
- if (PG(magic_quotes_runtime)) {
- value = php_addslashes(md.token_data, 0, &md.token_len, 0 TSRMLS_CC);
- } else {
- value = estrndup(md.token_data, md.token_len);
- }
+ value = estrndup(md.token_data, md.token_len);
have_content = 1;
}
@@ -543,12 +535,6 @@ PHP_FUNCTION(file_get_contents)
/* uses mmap if possible */
if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) {
-
- if (PG(magic_quotes_runtime)) {
- contents = php_addslashes(contents, len, &newlen, 1 TSRMLS_CC); /* 1 = free source string */
- len = newlen;
- }
-
RETVAL_STRINGL(contents, len, 0);
} else if (len == 0) {
RETVAL_EMPTY_STRING();
@@ -778,13 +764,7 @@ PHP_FUNCTION(file)
do {
p++;
parse_eol:
- if (PG(magic_quotes_runtime)) {
- /* s is in target_buf which is freed at the end of the function */
- slashed = php_addslashes(s, (p-s), &len, 0 TSRMLS_CC);
- add_index_stringl(return_value, i++, slashed, len, 0);
- } else {
- add_index_stringl(return_value, i++, estrndup(s, p-s), p-s, 0);
- }
+ add_index_stringl(return_value, i++, estrndup(s, p-s), p-s, 0);
s = p;
} while ((p = memchr(p, eol_marker, (e-p))));
} else {
@@ -793,13 +773,7 @@ parse_eol:
s = ++p;
continue;
}
- if (PG(magic_quotes_runtime)) {
- /* s is in target_buf which is freed at the end of the function */
- slashed = php_addslashes(s, (p-s), &len, 0 TSRMLS_CC);
- add_index_stringl(return_value, i++, slashed, len, 0);
- } else {
- add_index_stringl(return_value, i++, estrndup(s, p-s), p-s, 0);
- }
+ add_index_stringl(return_value, i++, estrndup(s, p-s), p-s, 0);
s = ++p;
} while ((p = memchr(p, eol_marker, (e-p))));
}
@@ -1038,18 +1012,9 @@ PHPAPI PHP_FUNCTION(fgets)
}
if (is_unicode) {
- /* UTODO: magic_quotes_runtime */
RETURN_UNICODEL(buf, num_chars, 0);
} else {
- if (PG(magic_quotes_runtime)) {
- int len;
- char *str;
-
- str = php_addslashes((char*)buf, num_bytes, &len, 1 TSRMLS_CC);
- RETURN_STRINGL(str, len, 0);
- } else {
RETURN_STRINGL((char*)buf, num_bytes, 0);
- }
}
}
/* }}} */
@@ -1248,9 +1213,6 @@ PHPAPI PHP_FUNCTION(fwrite)
if (write_len < 0 || write_len > Z_USTRLEN_P(zstring)) {
write_len = Z_USTRLEN_P(zstring);
}
-
- /* UTODO Handle magic_quotes_runtime for unicode strings */
-
ret = php_stream_u_write(stream, Z_USTRVAL_P(zstring), write_len);
/* Convert data points back to code units */
@@ -1267,10 +1229,6 @@ PHPAPI PHP_FUNCTION(fwrite)
}
num_bytes = write_len;
- if (argc < 3 && PG(magic_quotes_runtime)) {
- buffer = estrndup(Z_STRVAL_P(zstring), num_bytes);
- php_stripslashes(buffer, &num_bytes TSRMLS_CC);
- }
ret = php_stream_write(stream, buffer ? buffer : Z_STRVAL_P(zstring), num_bytes);
if (buffer) {
efree(buffer);
@@ -1828,16 +1786,11 @@ PHPAPI PHP_FUNCTION(fread)
}
if (is_unicode) {
- /* UTODO - magic_quotes_runtime */
-
buf[num_bytes] = 0;
buf[num_bytes + 1] = 0;
RETURN_UNICODEL((UChar *)buf, num_bytes >> 1, 0);
} else {
buf[num_bytes] = 0;
- if (PG(magic_quotes_runtime)) {
- buf = php_addslashes(buf, num_bytes, &num_bytes, 1 TSRMLS_CC);
- }
RETURN_STRINGL(buf, num_bytes, 0);
}
}
@@ -1976,16 +1929,7 @@ PHP_FUNCTION(fputcsv)
smart_str_appendc(&csvline, '\n');
smart_str_0(&csvline);
- if (!PG(magic_quotes_runtime)) {
- ret = php_stream_write(stream, csvline.c, csvline.len);
- } else {
- char *buffer = estrndup(csvline.c, csvline.len);
- int len = csvline.len;
- php_stripslashes(buffer, &len TSRMLS_CC);
- ret = php_stream_write(stream, buffer, len);
- efree(buffer);
- }
-
+ ret = php_stream_write(stream, csvline.c, csvline.len);
smart_str_free(&csvline);
RETURN_LONG(ret);