diff --git a/Blacklight/NameFixer.php b/Blacklight/NameFixer.php index d924407c7..0d789df11 100755 --- a/Blacklight/NameFixer.php +++ b/Blacklight/NameFixer.php @@ -2470,7 +2470,7 @@ class NameFixer $this->_cleanMatchFiles(); $this->cleanFileNames(); if (! empty($this->_fileName)) { - foreach ($this->sphinx->searchIndexes('predb_rt', $this->_fileName, 'title') as $match) { + foreach ($this->sphinx->searchIndexes('predb_rt', $this->_fileName, ['title']) as $match) { if (! empty($match)) { $this->updateRelease($release, $match['title'], 'PreDb: Title match', $echo, $type, $nameStatus, $show, $match['id']); diff --git a/Blacklight/Releases.php b/Blacklight/Releases.php index 6dd76c5be..6c8074881 100755 --- a/Blacklight/Releases.php +++ b/Blacklight/Releases.php @@ -635,7 +635,7 @@ class Releases - $results = $this->sphinxSearch->searchIndexes('releases_rt', '', '', $searchFields); + $results = $this->sphinxSearch->searchIndexes('releases_rt', '', [], $searchFields); $searchResult = array_pluck($results, 'id'); diff --git a/Changelog b/Changelog index db7328eca..dbcada036 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2019-01-21 DariusIII + * Fix: Fix issues reported by scrutinizer (strings where arrays are expected and vice versa) * Chg: Update search, update matching 2019-01-20 DariusIII * Chg: Update rest of the cover checking files diff --git a/app/Models/Predb.php b/app/Models/Predb.php index af979c728..db4a79e87 100644 --- a/app/Models/Predb.php +++ b/app/Models/Predb.php @@ -173,17 +173,17 @@ class Predb extends Model } /** - * @param array $search + * @param string $search * * @return mixed * @throws \Exception */ - public static function getAll($search = []) + public static function getAll($search = '') { $sql = self::query()->remember(config('nntmux.cache_expiry_medium'))->leftJoin('releases', 'releases.predb_id', '=', 'predb.id')->orderByDesc('predb.predate'); if (! empty($search)) { $sphinx = new SphinxSearch(); - $ids = array_pluck($sphinx->searchIndexes('predb_rt', $search, 'title'), 'id'); + $ids = array_pluck($sphinx->searchIndexes('predb_rt', $search, ['title']), 'id'); $sql->whereIn('predb.id', $ids); }