From c57325db57f5e2c17d1989bcbc116fd1b373db5f Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 11 Sep 2017 15:19:41 +0200 Subject: [PATCH] Prevent releases with filename SAMPLE/sample to be inserted into predb table (prevents wrong renames of releases, hopefuly) --- Changelog | 1 + nntmux/IRCScraper.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index d994afaa8..dffce824e 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2017-09-11 DariusIII + * Chg: Prevent releases with filename SAMPLE/sample to be inserted into predb table (prevents wrong renames of releases, hopefuly) * Chg: Update php-tmdb/api to version 2.1.10 2017-09-08 DariusIII * Chg: Update predb_hashes table and triggers diff --git a/nntmux/IRCScraper.php b/nntmux/IRCScraper.php index 1894adce1..7fc81e2ca 100755 --- a/nntmux/IRCScraper.php +++ b/nntmux/IRCScraper.php @@ -297,7 +297,7 @@ class IRCScraper extends IRCClient $query .= (! empty($this->_curPre['reqid']) ? 'requestid, ' : ''); $query .= (! empty($this->_curPre['group_id']) ? 'groups_id, ' : ''); $query .= (! empty($this->_curPre['nuked']) ? 'nuked, ' : ''); - $query .= (! empty($this->_curPre['filename']) ? 'filename, ' : ''); + $query .= (! empty($this->_curPre['filename']) && ! preg_match('/^sample$/i', $this->_curPre['filename']) ? 'filename, ' : ''); $query .= 'predate, title) VALUES ('; @@ -309,7 +309,7 @@ class IRCScraper extends IRCClient $query .= (! empty($this->_curPre['reqid']) ? $this->_curPre['reqid'].', ' : ''); $query .= (! empty($this->_curPre['group_id']) ? $this->_curPre['group_id'].', ' : ''); $query .= (! empty($this->_curPre['nuked']) ? $this->_curPre['nuked'].', ' : ''); - $query .= (! empty($this->_curPre['filename']) ? $this->_pdo->escapeString($this->_curPre['filename']).', ' : ''); + $query .= (! empty($this->_curPre['filename']) && ! preg_match('/^sample$/i', $this->_curPre['filename']) ? $this->_pdo->escapeString($this->_curPre['filename']).', ' : ''); $query .= (! empty($this->_curPre['predate']) ? $this->_curPre['predate'].', ' : 'NOW(), '); $query .= '%s)'; @@ -347,7 +347,7 @@ class IRCScraper extends IRCClient $query .= (! empty($this->_curPre['group_id']) ? 'groups_id = '.$this->_curPre['group_id'].', ' : ''); $query .= (! empty($this->_curPre['predate']) ? 'predate = '.$this->_curPre['predate'].', ' : ''); $query .= (! empty($this->_curPre['nuked']) ? 'nuked = '.$this->_curPre['nuked'].', ' : ''); - $query .= (! empty($this->_curPre['filename']) ? 'filename = '.$this->_pdo->escapeString($this->_curPre['filename']).', ' : ''); + $query .= (! empty($this->_curPre['filename']) && ! preg_match('/^sample$/i', $this->_curPre['filename']) ? 'filename = '.$this->_pdo->escapeString($this->_curPre['filename']).', ' : ''); $query .= ( (empty($this->_oldPre['category']) && ! empty($this->_curPre['category'])) ? 'category = '.$this->_pdo->escapeString($this->_curPre['category']).', '