diff --git a/lib/weblib.php b/lib/weblib.php index 1f051bce103..41a6a6ce7ca 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -98,9 +98,8 @@ $ALLOWED_PROTOCOLS = array('http', 'https', 'ftp', 'news', 'mailto', 'rtsp', 'te * @return string */ function s($var) { - - if (empty($var)) { - return ''; + if ($var == '0') { // for integer 0, boolean false, string '0' + return '0'; } return htmlSpecialChars(stripslashes_safe($var)); } @@ -115,11 +114,11 @@ function s($var) { * @return string */ function p($var) { - - if (empty($var)) { - echo ''; + if ($var == '0') { // for integer 0, boolean false, string '0' + echo '0'; + } else { + echo htmlSpecialChars(stripslashes_safe($var)); } - echo htmlSpecialChars(stripslashes_safe($var)); } @@ -4284,7 +4283,7 @@ class tabobject { $cstr = ''; /// The text and anchor for this tab - if ($inactive || $activetwo) { + if ($inactive || $activetwo || $selected) { $astr .= $this->text; } else { $astr .= ''.$this->text.'';