Jack Phoenix has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/327927 )
Change subject: Allow callers to override the default alt attribute in
wAvatar::getAvatarURL()
......................................................................
Allow callers to override the default alt attribute in wAvatar::getAvatarURL()
Bug: T153521
Bug: T153523
Change-Id: Ic9494d74c625df84025a1074088756254785239d
---
M UserProfile/AvatarClass.php
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SocialProfile
refs/changes/27/327927/1
diff --git a/UserProfile/AvatarClass.php b/UserProfile/AvatarClass.php
index 656e09f..eda5add 100644
--- a/UserProfile/AvatarClass.php
+++ b/UserProfile/AvatarClass.php
@@ -63,9 +63,13 @@
$defaultParams = array(
'src' =>
"{$wgUploadPath}/avatars/{$this->getAvatarImage()}",
- 'alt' => 'avatar',
'border' => '0',
);
+ // Allow callers to add a different alt attribute and only add
this
+ // default one if no alt attribute was provided in $extraParams
+ if ( empty( $extraParams['alt'] ) ) {
+ $defaultParams['alt'] = 'avatar';
+ }
if ( $wgUserProfileDisplay['avatar'] === false ) {
$defaultParams['src'] =
'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
// Replace by a white pixel
--
To view, visit https://gerrit.wikimedia.org/r/327927
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9494d74c625df84025a1074088756254785239d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SocialProfile
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits