From: Barış Metin Date: Thu, 28 Jan 2010 12:03:52 +0000 (+0000) Subject: don't let empty strings kill the server (postgresql and apache) X-Git-Tag: PLEWWW-4.3-42~5 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=1b1eb1d6a94cfcd76b9c16be3ce2a5ec7b512794;p=plewww.git don't let empty strings kill the server (postgresql and apache) --- diff --git a/planetlab/common/adminsearch.php b/planetlab/common/adminsearch.php index 37fbe56..ee2da8f 100644 --- a/planetlab/common/adminsearch.php +++ b/planetlab/common/adminsearch.php @@ -33,7 +33,11 @@ if ( ! plc_is_admin()) { $pattern=""; if (isset($_GET['pattern'])) { $pattern=$_GET['pattern']; } if (isset($_POST['pattern'])) { $pattern=$_POST['pattern']; } + $tokens=split(" ",$pattern); +function token_filter ($t) { $t = trim($t); if (empty($t)) return false; return true; } +$tokens=array_filter($tokens, "token_filter"); + //////////////////// // from a single search form, extract all tokens entered