Permalink
Browse files

Now both p() and s() respect html entities.

  • Loading branch information...
stronk7
stronk7 committed Sep 10, 2005
1 parent 1ba6745 commit 43ea696c770d53023fb7c4fd4d89a8fc1ac4b99b
Showing with 2 additions and 6 deletions.
  1. +2 −6 lib/weblib.php
View
@@ -101,7 +101,7 @@ function s($var) {
if ($var == '0') { // for integer 0, boolean false, string '0'
return '0';
}
return htmlSpecialChars(stripslashes_safe($var));
return preg_replace("/&(\w+|#\d+);/i", "&$1;", htmlspecialchars(stripslashes_safe($var)));
}
/**
@@ -114,11 +114,7 @@ function s($var) {
* @return string
*/
function p($var) {
if ($var == '0') { // for integer 0, boolean false, string '0'
echo '0';
} else {
echo htmlSpecialChars(stripslashes_safe($var));
}
echo s($var);
}

0 comments on commit 43ea696

Please sign in to comment.