Skip to content

Commit 2ba4939

Browse files
committed
fix type conversion warnings in php 8.*
1 parent e0567af commit 2ba4939

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/Iodev/Whois/Modules/Tld/Parsers/BlockParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ protected function parseDate(
425425
return 0;
426426
}
427427
foreach ($sel->getAll() as $str) {
428-
if (preg_match($fallbackRegex, $str)) {
428+
if ($str && preg_match($fallbackRegex, $str)) {
429429
$time = DateHelper::parseDateInText($str);
430430
if (!empty($time)) {
431431
return $time;

tests/Iodev/Whois/Modules/Tld/TldParsingTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ private static function sort($a)
5252
*/
5353
private static function parseExpectedDate($datestr)
5454
{
55+
if ($datestr === null) {
56+
$datestr = '';
57+
}
5558
// replace %param by value
5659
if (strpos($datestr, '%') !== false) {
5760
$datestr = preg_replace('~^%Y(-\d\d-\d\dT\d\d:\d\d)$~', date('Y').'\1', $datestr);

0 commit comments

Comments
 (0)