diff --git a/Blacklight/IRCClient.php b/Blacklight/IRCClient.php index d87d6c812..0db68f055 100755 --- a/Blacklight/IRCClient.php +++ b/Blacklight/IRCClient.php @@ -343,14 +343,14 @@ class IRCClient $this->_pong($matches[1]); } elseif (preg_match('/^:(.*?)\s+(\d+).*?(:.+?)?$/', $this->_buffer, $matches)) { // We found 001, which means we are logged in. - if ($matches[2] == 001) { + if ((int) $matches[2] === 1) { $this->_remote_host_received = $matches[1]; break; // We got 464, which means we need to send a password. } - if ($matches[2] == 464) { + if ((int)$matches[2] === 464) { // Before the lower check, set the password : username:password $tempPass = $userName.':'.$password; diff --git a/Blacklight/IRCScraper.php b/Blacklight/IRCScraper.php index ace3abbec..68f925d2a 100755 --- a/Blacklight/IRCScraper.php +++ b/Blacklight/IRCScraper.php @@ -4,6 +4,7 @@ namespace Blacklight; use App\Models\Group; use App\Models\Predb; +use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; /** @@ -219,7 +220,9 @@ class IRCScraper extends IRCClient return; } - $this->_curPre['predate'] = 'FROM_UNIXTIME((strtotime($matches["time"]." UTC")))'; + $utime = Carbon::createFromTimeString($matches['time'], 'UTC')->timestamp; + + $this->_curPre['predate'] = 'FROM_UNIXTIME('.$utime.')'; $this->_curPre['title'] = $matches['title']; $this->_curPre['source'] = $matches['source']; if ($matches['category'] !== 'N/A') {