Skip to content

Instantly share code, notes, and snippets.

@paulyg
Created January 15, 2011 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulyg/780577 to your computer and use it in GitHub Desktop.
Save paulyg/780577 to your computer and use it in GitHub Desktop.
Diff to fix PHP bug 53755, FILTER_SANITIZE_STRING truncates string with unmatched "<" character
--- sanitizing_filters.orig.c 2010-03-31 18:59:09.000000000 -0400
+++ sanitizing_filters.c 2011-01-14 17:36:32.000000000 -0500
@@ -200,7 +200,7 @@
php_filter_encode_html(value, enc);
/* strip tags, implicitly also removes \0 chars */
- new_len = php_strip_tags_ex(Z_STRVAL_P(value), Z_STRLEN_P(value), NULL, NULL, 0, 1);
+ new_len = php_strip_tags_ex(Z_STRVAL_P(value), Z_STRLEN_P(value), NULL, NULL, 0, 0);
Z_STRLEN_P(value) = new_len;
if (new_len == 0) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment