oop, only update if we have data ...

git-svn-id: file:///svn/phpbb/trunk@4064 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2003-05-27 00:46:10 +00:00
parent b6a0ce82d4
commit 208f1e59bf

View file

@ -149,7 +149,7 @@ class ucp_profile extends ucp
$validate = array( $validate = array(
'match' => array( 'match' => array(
'icq' => ($data['icq']) ? '#^[0-9]+$#i' : '', '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); $this->validate_data($data, $validate);
@ -383,6 +383,9 @@ class ucp_profile extends ucp
} }
if (!sizeof($this->error)) if (!sizeof($this->error))
{
// Do we actually have any data to update?
if (sizeof($data))
{ {
$sql_ary = array( $sql_ary = array(
'user_avatar' => $data['filename'], 'user_avatar' => $data['filename'],
@ -401,6 +404,7 @@ class ucp_profile extends ucp
{ {
$this->avatar_delete(); $this->avatar_delete();
} }
}
meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$submode"); meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$submode");
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode\">", '</a>'); $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&amp;i=$id&amp;mode=$submode\">", '</a>');
@ -485,8 +489,6 @@ class ucp_profile extends ucp
$this->display($user->lang['UCP_PROFILE'], 'ucp_profile.html'); $this->display($user->lang['UCP_PROFILE'], 'ucp_profile.html');
} }
} }
?> ?>