mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 14:30:32 +02:00
[ticket/16549] Fix tests
1. If $service array is empty, $service[0] call will throw fatal error in PHP 8. 2. Division by zero was promoted to fatal error and throws DivisionByZeroError exception in PHP 8+ 3. Adjust make_clickable() logic to avoid 'Undefined array key 3' error. PHPBB3-16549
This commit is contained in:
@@ -1010,7 +1010,7 @@ function make_clickable($text, $server_url = false, string $class = 'postlink')
|
||||
if (preg_match($magic_args[0], $text, $matches))
|
||||
{
|
||||
// Only apply $class from the corresponding function call argument (excepting emails which never has a class)
|
||||
if ($magic_args[3] != $static_class && $magic_args[1] != MAGIC_URL_EMAIL)
|
||||
if ($magic_args[1] != MAGIC_URL_EMAIL && $magic_args[3] != $static_class)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user