瀏覽代碼

Update functions.php (#4607)

removing potential for "Warning: sizeof(): Parameter must be an array or an object that implements Countable"
chansizzle 6 年之前
父節點
當前提交
f8b9ef3506
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      resources/functions.php

+ 4 - 2
resources/functions.php

@@ -1571,8 +1571,10 @@ function number_pad($number,$n) {
 					case 'up': $direction = 'keyup'; break;
 					case 'up': $direction = 'keyup'; break;
 				}
 				}
 			//check for element exceptions
 			//check for element exceptions
-				if (sizeof($exceptions) > 0) {
-					$exceptions = "!$(e.target).is('".implode(',', $exceptions)."') && ";
+				if (is_array($exceptions)) {
+					if (sizeof($exceptions) > 0) {
+						$exceptions = "!$(e.target).is('".implode(',', $exceptions)."') && ";
+					}
 				}
 				}
 			//quote if selector is id or class
 			//quote if selector is id or class
 				$subject = ($subject != 'window' && $subject != 'document') ? "'".$subject."'" : $subject;
 				$subject = ($subject != 'window' && $subject != 'document') ? "'".$subject."'" : $subject;