[ticket/10226] Use is_numeric() instead of preg_replace()

PHPBB3-10226
This commit is contained in:
rxu 2011-06-21 22:03:19 +08:00
parent 578f9dffa6
commit 18fb3d86cd

View file

@ -48,7 +48,7 @@ class dbal_mysqli extends dbal
$socket = NULL; $socket = NULL;
if ($port) if ($port)
{ {
if (preg_match('#^[0-9]+$#', $port)) if (is_numeric($port))
{ {
$port = (int) $port; $port = (int) $port;
} }