diff --git a/demo/web/index.php b/demo/web/index.php index 5fc97c33d..2b0489227 100644 --- a/demo/web/index.php +++ b/demo/web/index.php @@ -146,8 +146,10 @@ placeholder="empty"/> - - + "/> + "/>

WEB API (for developers):

diff --git a/demo/web/search-relay.php b/demo/web/search-relay.php index ab7c94206..b1345a2ac 100644 --- a/demo/web/search-relay.php +++ b/demo/web/search-relay.php @@ -74,7 +74,8 @@ function qry_explode($qry_str) $req_qry_str = ''; $req_page = 1; -if(!isset($_GET['q'])) { /* q for query string */ +/* q for query string */ +if(!isset($_GET['q']) || !is_scalar($_GET['q'])) { http_response_code(400); echo 'Dude, Bad GET Request!'; exit; @@ -82,10 +83,10 @@ function qry_explode($qry_str) $req_qry_str = $_GET['q']; } -if(isset($_GET['p'])) /* p for page */ +/* p for page */ +if(isset($_GET['p']) && is_scalar($_GET['p'])) $req_page = intval($_GET['p']); - /* * split and handle each query keyword */