From 24befac7b4879ae02a4416e47ca0deea93766b93 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 8 Jan 2013 23:18:17 +0100 Subject: [PATCH 1/2] [ticket/11301] Explicitly cast str offset to int to prevent E_NOTICE on 5.4. PHPBB3-11301 --- phpBB/includes/captcha/captcha_non_gd.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/captcha/captcha_non_gd.php b/phpBB/includes/captcha/captcha_non_gd.php index f82896f628..a823fa4226 100644 --- a/phpBB/includes/captcha/captcha_non_gd.php +++ b/phpBB/includes/captcha/captcha_non_gd.php @@ -119,7 +119,7 @@ class captcha $new_line = ''; $end = strlen($scanline) - ceil($width/2); - for ($i = floor($width/2); $i < $end; $i++) + for ($i = (int) floor($width/2); $i < $end; $i++) { $pixel = ord($scanline{$i}); From 41a07eedeb13349305977bb8882f0bd6429480e3 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 8 Jan 2013 23:20:30 +0100 Subject: [PATCH 2/2] [ticket/11301] Guidelines: Add spaces in front and after the / operator. PHPBB3-11301 --- phpBB/includes/captcha/captcha_non_gd.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/captcha/captcha_non_gd.php b/phpBB/includes/captcha/captcha_non_gd.php index a823fa4226..2adf909b96 100644 --- a/phpBB/includes/captcha/captcha_non_gd.php +++ b/phpBB/includes/captcha/captcha_non_gd.php @@ -119,7 +119,7 @@ class captcha $new_line = ''; $end = strlen($scanline) - ceil($width/2); - for ($i = (int) floor($width/2); $i < $end; $i++) + for ($i = (int) floor($width / 2); $i < $end; $i++) { $pixel = ord($scanline{$i});