Jelajahi Sumber

Update functions.php (#5137)

chansizzle 5 tahun lalu
induk
melakukan
f21426948a
1 mengubah file dengan 10 tambahan dan 2 penghapusan
  1. 10 2
      resources/functions.php

+ 10 - 2
resources/functions.php

@@ -17,7 +17,7 @@
 
 	The Initial Developer of the Original Code is
 	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2019
+	Portions created by the Initial Developer are Copyright (C) 2008-2020
 	the Initial Developer. All Rights Reserved.
 
 	Contributor(s):
@@ -1921,7 +1921,15 @@ function number_pad($number,$n) {
 
 //escape user data
 	function escape($string) {
-		return htmlentities($string, ENT_QUOTES | ENT_HTML5, 'UTF-8');
+		if (is_array($string)) {
+			return false;
+		}
+		elseif (isset($string) && strlen($string)) {
+			return htmlentities($string, ENT_QUOTES | ENT_HTML5, 'UTF-8');
+		}
+		else {
+			return false;
+		}
 		//return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
 	}