aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-05-27 00:46:10 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-05-27 00:46:10 +0000
commit208f1e59bf2b9d9ab2ea0ecc7dcac9c09031c3fb (patch)
treecf2e11f309bcf531072aaa3ed99dca31f52d85e1 /phpBB/includes/ucp
parentb6a0ce82d413a55f95c3c7149e9d9bf47cf2f6aa (diff)
downloadforums-208f1e59bf2b9d9ab2ea0ecc7dcac9c09031c3fb.tar
forums-208f1e59bf2b9d9ab2ea0ecc7dcac9c09031c3fb.tar.gz
forums-208f1e59bf2b9d9ab2ea0ecc7dcac9c09031c3fb.tar.bz2
forums-208f1e59bf2b9d9ab2ea0ecc7dcac9c09031c3fb.tar.xz
forums-208f1e59bf2b9d9ab2ea0ecc7dcac9c09031c3fb.zip
oop, only update if we have data ...
git-svn-id: file:///svn/phpbb/trunk@4064 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r--phpBB/includes/ucp/ucp_profile.php38
1 files changed, 20 insertions, 18 deletions
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index d5e757b326..b3a9dc111d 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -149,7 +149,7 @@ class ucp_profile extends ucp
$validate = array(
'match' => array(
'icq' => ($data['icq']) ? '#^[0-9]+$#i' : '',
- 'website' => ($data['website']) ? '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]+#i' : '',
+ 'website' => ($data['website']) ? '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i' : '',
),
);
$this->validate_data($data, $validate);
@@ -384,22 +384,26 @@ class ucp_profile extends ucp
if (!sizeof($this->error))
{
- $sql_ary = array(
- 'user_avatar' => $data['filename'],
- 'user_avatar_type' => $data['type'],
- 'user_avatar_width' => $data['width'],
- 'user_avatar_height' => $data['height'],
- );
-
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE user_id = ' . $user->data['user_id'];
- $db->sql_query($sql);
-
- // Delete old avatar if present
- if ($user->data['user_avatar'] != '' && $data['filename'] != $user->data['user_avatar'])
+ // Do we actually have any data to update?
+ if (sizeof($data))
{
- $this->avatar_delete();
+ $sql_ary = array(
+ 'user_avatar' => $data['filename'],
+ 'user_avatar_type' => $data['type'],
+ 'user_avatar_width' => $data['width'],
+ 'user_avatar_height' => $data['height'],
+ );
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE user_id = ' . $user->data['user_id'];
+ $db->sql_query($sql);
+
+ // Delete old avatar if present
+ if ($user->data['user_avatar'] != '' && $data['filename'] != $user->data['user_avatar'])
+ {
+ $this->avatar_delete();
+ }
}
meta_refresh(3, "ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode");
@@ -485,8 +489,6 @@ class ucp_profile extends ucp
$this->display($user->lang['UCP_PROFILE'], 'ucp_profile.html');
}
-
-
}
?> \ No newline at end of file