diff --git a/php/access/admin.php b/php/access/admin.php index d1c92ed..33e171a 100644 --- a/php/access/admin.php +++ b/php/access/admin.php @@ -111,8 +111,8 @@ switch ($_POST['function']) { // Search Function - case 'search': if (isset($_POST['term'])) - echo json_encode(search($_POST['term'])); + case 'search': if (!isset($_POST['term'])) exit(); + echo json_encode(search($database, $settings, $_POST['term'])); break; // Session Function diff --git a/php/modules/misc.php b/php/modules/misc.php index f950069..9755779 100755 --- a/php/modules/misc.php +++ b/php/modules/misc.php @@ -39,9 +39,9 @@ function getGraphHeader($database, $photoID) { } -function search($term) { +function search($database, $settings, $term) { - global $database, $settings; + if (!isset($database, $settings, $term)) return false; $return['albums'] = '';