From 8a3cc9ed5caec7c76b2fd0f83d3ef904ddbc596e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sat, 14 Dec 2013 10:59:22 +0100 Subject: [PATCH] Properly use constants. re #127 --- book.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/book.php b/book.php index c83c3e3..73b6faa 100644 --- a/book.php +++ b/book.php @@ -560,7 +560,11 @@ where data.book = books.id and data.id = ?'); global $config; $i = 0; $critArray = array (); - foreach (array ("author", "tag", "series", "publisher", "book") as $key) { + foreach (array (PageQueryResult::SCOPE_AUTHOR, + PageQueryResult::SCOPE_TAG, + PageQueryResult::SCOPE_SERIES, + PageQueryResult::SCOPE_PUBLISHER, + PageQueryResult::SCOPE_BOOK) as $key) { if (in_array($key, $config ['cops_ignored_search_scope']) || (!array_key_exists ($key, $query) && !array_key_exists ("all", $query))) { $critArray [$i] = self::BAD_SEARCH; @@ -653,7 +657,11 @@ function getJson ($complete = false) { return $out; } - foreach (array ("book", "author", "series", "tag", "publisher") as $key) { + foreach (array (PageQueryResult::SCOPE_BOOK, + PageQueryResult::SCOPE_AUTHOR, + PageQueryResult::SCOPE_SERIES, + PageQueryResult::SCOPE_TAG, + PageQueryResult::SCOPE_PUBLISHER) as $key) { if (in_array($key, $config ['cops_ignored_search_scope'])) { continue; }