mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-09-03 03:38:52 +00:00
More fixes
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ require_once(dirname(__FILE__)."/../lib/showsleep.php");
|
||||
require_once(dirname(__FILE__)."/../lib/functions.php");
|
||||
|
||||
|
||||
$version="0.3r1091";
|
||||
$version="0.3r1092";
|
||||
|
||||
$db = new DB();
|
||||
$functions = new Functions();
|
||||
|
||||
+4
-4
@@ -1127,7 +1127,7 @@ class Film
|
||||
$andYearIn .= $end . ')';
|
||||
}
|
||||
$IMDBCheck = $this->db->queryOneRow(
|
||||
sprintf('%s WHERE title %s %s', $query, $this->db->likeString($this->currentTitle), $andYearIn));
|
||||
sprintf('%s WHERE title %s %s', $query, $this->functions->likeString($this->currentTitle), $andYearIn));
|
||||
|
||||
// Look by %word%word%word% etc..
|
||||
if ($IMDBCheck === false) {
|
||||
@@ -1138,7 +1138,7 @@ class Film
|
||||
}
|
||||
$IMDBCheck = $this->db->queryOneRow(
|
||||
sprintf("%s WHERE replace(replace(title, \"'\", ''), '!', '') %s %s",
|
||||
$query, $this->db->likeString($tempTitle), $andYearIn
|
||||
$query, $this->functions->likeString($tempTitle), $andYearIn
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -1149,7 +1149,7 @@ class Film
|
||||
if ($tempTitle !== $this->currentTitle) {
|
||||
$IMDBCheck = $this->db->queryOneRow(
|
||||
sprintf('%s WHERE title %s %s',
|
||||
$query, $this->db->likeString($tempTitle), $andYearIn
|
||||
$query, $this->functions->likeString($tempTitle), $andYearIn
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1162,7 +1162,7 @@ class Film
|
||||
}
|
||||
$IMDBCheck = $this->db->queryOneRow(
|
||||
sprintf("%s WHERE replace(replace(replace(title, \"'\", ''), '!', ''), '\"', '') %s %s",
|
||||
$query, $this->db->likeString($tempTitle), $andYearIn
|
||||
$query, $this->functions->likeString($tempTitle), $andYearIn
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3651,6 +3651,27 @@ class Functions
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a 'like' string. ex.(LIKE '%chocolate%')
|
||||
*
|
||||
* @param string $str The string.
|
||||
* @param bool $left Add a % to the left.
|
||||
* @param bool $right Add a % to the right.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function likeString($str, $left=true, $right=true)
|
||||
{
|
||||
return (
|
||||
(DB_TYPE === 'mysql' ? 'LIKE ' : 'ILIKE ') .
|
||||
$this->escapeString(
|
||||
($left ? '%' : '') .
|
||||
$str .
|
||||
($right ? '%' : '')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//end of testing
|
||||
|
||||
Reference in New Issue
Block a user