Browse Source

Removed global vars from search

Tobias Reich 11 years ago
parent
commit
368f6b59d0
2 changed files with 4 additions and 4 deletions
  1. 2 2
      php/access/admin.php
  2. 2 2
      php/modules/misc.php

+ 2 - 2
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

+ 2 - 2
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'] = '';