summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Robinson <joe@lc8n.com>2015-12-07 00:41:48 +0000
committerJoe Robinson <joe@lc8n.com>2015-12-07 00:41:48 +0000
commit7bc73dd3d1b1af00fe1f88bdb8f9595d96b19fe0 (patch)
treee84124ded6554ae6da8bdc60f89a0753d50ac23f
parentab30739538bffdf08ee2f3661b1ea83eb33dba7f (diff)
Clean up whitespace
-rw-r--r--search.php12
1 files changed, 6 insertions, 6 deletions
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.