Update of /cvsroot/fink/web/pdb
In directory sc8-pr-cvs17:/tmp/cvs-serv22866

Modified Files:
        browse.php 
Log Message:
handle short search strings nicely

Index: browse.php
===================================================================
RCS file: /cvsroot/fink/web/pdb/browse.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- browse.php  27 Oct 2007 13:54:37 -0000      1.11
+++ browse.php  6 Nov 2007 19:32:26 -0000       1.12
@@ -155,10 +155,13 @@
 $invalid_param = false;
 list($maintainer, $inv_p) = get_safe_param('maintainer', '/[EMAIL 
PROTECTED]&\'\\\ ]+$/');
 $invalid_param = $invalid_param || $inv_p;
+if ($inv_p) { $invalid_param_text = 'Maintainer contained invalid 
characters!'; }
 list($name, $inv_p) = get_safe_param('name', '/^[a-z0-9+\-.%]+$/');
 $invalid_param = $invalid_param || $inv_p;
-list($summary, $inv_p) = get_safe_param('summary', '/.*/');
+if ($inv_p) { $invalid_param_text = 'Name contained invalid characters!'; }
+list($summary, $inv_p) = get_safe_param('summary', '/...*/');
 $invalid_param = $invalid_param || $inv_p;
+if ($inv_p) { $invalid_param_text = 'Summary search must be at least 2 
characters!'; }
 list($nolist, $inv_p) = get_safe_param('nolist', '/on/');
 $invalid_param = $invalid_param || $inv_p;
 
@@ -201,7 +204,7 @@
 <input name="submit" type="submit" value="Search">
 <input type="reset" value="Clear Form">
 <br>
-<?if ($invalid_param) print '<p class="attention">Invalid Input 
Parameters!</p>';?>
+<?if ($invalid_param) print '<p class="attention">Invalid Input Parameters.  ' 
. $invalid_param_text . '</p>';?>
 <br>
 
 <span class="expand_adv_options">


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Fink-commits mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to