From 7bc73dd3d1b1af00fe1f88bdb8f9595d96b19fe0 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Mon, 7 Dec 2015 00:41:48 +0000 Subject: Clean up whitespace --- search.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'search.php') diff --git a/search.php b/search.php index 0aeb0b9..2c9ddb7 100644 --- a/search.php +++ b/search.php @@ -10,7 +10,7 @@ try { if (!$config = parse_ini_file("config.ini")) { throw new Exception('Could not parse ini file'); } - + // hash the password if (isset($config['password'])) { $hash = hash("sha256", $config['password']); @@ -22,7 +22,7 @@ try { curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $output = json_decode(curl_exec($curl)); curl_close($curl); - + $search = read_stdin(); if (empty($search)) { @@ -65,18 +65,18 @@ try { throw new Exception("Page `" . $page . "` is not valid"); } - + // remove the pagination from the search args $pos = array_search("#" . $page, $args); if ($pos) { $args[$pos] = null; } - + // Really slow search $results = []; foreach ($output as $upload) { $match = false; - foreach ($args as $arg) { + foreach ($args as $arg) { if (!is_null($arg) && stripos($upload->filename, $arg) === false) { $match = false; break; @@ -121,7 +121,7 @@ try { } function read_stdin() -{ +{ $fr=fopen("php://stdin","r"); // open our file pointer to read from stdin $input = fgets($fr,128); // read a maximum of 128 characters $input = rtrim($input); // trim any trailing spaces. -- cgit v1.2.3