From 5384eedd687e60a1d92aeab5b86f534b055d83b6 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Fri, 27 Jan 2006 21:23:22 +0000 Subject: [PATCH] Truncate the URI to the size of the database field before we check it to ensure that what is stored in the database is the same as that we checked git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5501 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/usercp_avatar.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpBB/includes/usercp_avatar.php b/phpBB/includes/usercp_avatar.php index 20034c643d..5429856a44 100644 --- a/phpBB/includes/usercp_avatar.php +++ b/phpBB/includes/usercp_avatar.php @@ -100,6 +100,8 @@ function user_avatar_url($mode, &$error, &$error_msg, $avatar_filename) $avatar_filename = 'http://' . $avatar_filename; } + $avatar_filename = substr($avatar_filename, 0, 100); + if ( !preg_match("#^((ht|f)tp://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png))$)#is", $avatar_filename) ) { $error = true;