diff options
author | Joe Robinson <joe@lc8n.com> | 2015-12-07 00:41:48 +0000 |
---|---|---|
committer | Joe Robinson <joe@lc8n.com> | 2015-12-07 00:41:48 +0000 |
commit | 7bc73dd3d1b1af00fe1f88bdb8f9595d96b19fe0 (patch) | |
tree | e84124ded6554ae6da8bdc60f89a0753d50ac23f | |
parent | ab30739538bffdf08ee2f3661b1ea83eb33dba7f (diff) |
Clean up whitespace
-rw-r--r-- | search.php | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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. |