[Pushed] Avatar warnings when editing user profile in admincp
#1
admin/modules/users/users.php
Warning generated when saving user profile and no avatar_url

<error>
	<dateline>1705500247</dateline>
	<datetime>2024-01-17 14:04:07 UTC -0500</datetime>
	<script>admin/modules/user/users.php</script>
	<line>635</line>
	<type>2</type>
	<friendly_type>Warning</friendly_type>
	<message>Undefined array key "avatar_url"</message>
	<back_trace>#0  errorHandler->error() called at [/inc/class_error.php:153]
#1  errorHandler->error_callback() called at [/admin/modules/user/users.php:635]
#2  require() called at [/admin/index.php:834]
</back_trace>
</error>

Find line 635
			else if($mybb->input['avatar_url'] && $mybb->input['avatar_url'] != $user['avatar'])
and replace with
			else if(isset($mybb->input['avatar_url']) && $mybb->input['avatar_url'] != $user['avatar'])

Also, if avatar_url is empty when saving with another error condition, like password change without confirmation of password, then
<error>
	<dateline>1705503990</dateline>
	<datetime>2024-01-17 15:06:30 UTC -0500</datetime>
	<script>admin/modules/user/users.php</script>
	<line>1547</line>
	<type>2</type>
	<friendly_type>Warning</friendly_type>
	<message>Undefined array key "avatar_url"</message>
	<back_trace>#0  errorHandler->error() called at [/inc/class_error.php:153]
#1  errorHandler->error_callback() called at [/admin/modules/user/users.php:1547]
#2  require() called at [/admin/index.php:834]
</back_trace>
</error>

Replace line 1547
			$avatar_url = htmlspecialchars_uni($mybb->input['avatar_url']);
with
		if(isset($mybb->input['avatar_url']))
			{$avatar_url = htmlspecialchars_uni($mybb->input['avatar_url']);}
Reply
#2
Tracking in https://github.com/mybb/mybb/issues/4775...1897013054
devilshakerz.com/pgp (DF3A 34D9 A627 42E5 BC6A 6750 1F2F B8AA 28FF E1BC) ▪ keybase.io/devilshakerz
Reply
#3
https://github.com/mybb/mybb/pull/4785
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)