Page MenuHomePhabricator

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in SpecialBotPasswords.php on line 107
Closed, ResolvedPublic

Description

( ! ) Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/wiki/mediawiki/core/includes/specials/SpecialBotPasswords.php on line 107
Call Stack
#	Time	Memory	Function	Location
1	0.0001	365192	{main}( )	.../index.php:0
2	0.0422	4605424	wfIndexMain( )	.../index.php:46
3	0.0422	4605520	MediaWiki->run( )	.../index.php:50
4	0.0422	4605520	MediaWiki->main( )	.../MediaWiki.php:559
5	0.0427	4810616	MediaWiki->performRequest( )	.../MediaWiki.php:901
6	0.0451	4872184	MediaWiki\SpecialPage\SpecialPageFactory->executePath( $path = class Title { private $mTextform = 'BotPasswords'; private $mUrlform = 'BotPasswords'; private $mDbkeyform = 'BotPasswords'; private $mNamespace = -1; private $mInterwiki = ''; private $mLocalInterwiki = FALSE; private $mFragment = ''; public $mArticleID = 0; protected $mLatestID = FALSE; private $mContentModel = FALSE; private $mForcedContentModel = FALSE; private $mEstimateRevisions = NULL; public $prefixedText = NULL; protected $mLength = -1; public $mRedirect = NULL; private $mHasSubpages = NULL; private $mPageLanguage = NULL; private $mDbPageLanguage = FALSE; private $mTitleValue = NULL; private $mIsBigDeletion = NULL; private $mIsValid = TRUE; private $mInstanceCacheKey = NULL; protected $deprecatedPublicProperties = ['mTextform' => [...], 'mUrlform' => [...], 'mDbkeyform' => [...], 'mNamespace' => [...], 'mInterwiki' => [...], 'mFragment' => [...]]; private $dynamicPropertiesAccessDeprecated = FALSE }, $context = class RequestContext { private $request = class WebRequest { protected $data = [...]; protected $queryAndPathParams = [...]; protected $queryParams = [...]; protected $headers = [...]; private $response = class WebResponse { ... }; private $ip = '10.13.37.100'; protected $requestTime = 1668032590.9707; protected $protocol = 'https'; protected $sessionId = class MediaWiki\Session\SessionId { ... }; protected $markedAsSafe = FALSE }; private $title = class Title { private $mTextform = 'BotPasswords'; private $mUrlform = 'BotPasswords'; private $mDbkeyform = 'BotPasswords'; private $mNamespace = -1; private $mInterwiki = ''; private $mLocalInterwiki = FALSE; private $mFragment = ''; public $mArticleID = 0; protected $mLatestID = FALSE; private $mContentModel = FALSE; private $mForcedContentModel = FALSE; private $mEstimateRevisions = NULL; public $prefixedText = 'Special:BotPasswords'; protected $mLength = -1; public $mRedirect = NULL; private $mHasSubpages = NULL; private $mPageLanguage = NULL; private $mDbPageLanguage = FALSE; private $mTitleValue = NULL; private $mIsBigDeletion = NULL; private $mIsValid = NULL; private $mInstanceCacheKey = NULL; protected $deprecatedPublicProperties = [...]; private $dynamicPropertiesAccessDeprecated = FALSE }; private $wikipage = NULL; private $action = NULL; private $output = class OutputPage { private ${ContextSource}context = ...; protected $mMetatags = [...]; protected $mLinktags = [...]; protected $mCanonicalUrl = FALSE; private $mPageTitle = ''; private $displayTitle = NULL; private $cacheIsFinal = FALSE; public $mBodytext = ''; private $mHTMLtitle = ''; private $mIsArticle = FALSE; private $mIsArticleRelated = TRUE; private $mHasCopyright = FALSE; private $mPrintable = FALSE; private $mSections = [...]; private $mSubtitle = [...]; public $mRedirect = ''; protected $mStatusCode = NULL; protected $mLastModified = ''; protected $mCategoryLinks = [...]; protected $mCategories = [...]; protected $mIndicators = [...]; private $mLanguageLinks = [...]; private $mScripts = ''; protected $mInlineStyles = ''; public $mPageLinkTitle = ''; protected $mAdditionalHtmlClasses = [...]; protected $mHeadItems = [...]; protected $mAdditionalBodyClasses = [...]; protected $mModules = [...]; protected $mModuleStyles = [...]; protected $mResourceLoader = NULL; private $rlClient = NULL; private $rlClientContext = NULL; private $rlExemptStyleModules = NULL; protected $mJsConfigVars = [...]; protected $mTemplateIds = [...]; protected $mImageTimeKeys = [...]; public $mRedirectCode = ''; protected $mFeedLinksAppendQuery = NULL; protected $mAllowedModules = [...]; protected $mDoNothing = FALSE; protected $mParserOptions = NULL; private $mFeedLinks = [...]; protected $mEnableClientCache = TRUE; private $mArticleBodyOnly = FALSE; protected $mNewSectionLink = FALSE; protected $mHideNewSectionLink = FALSE; public $mNoGallery = FALSE; protected $mCdnMaxage = 0; protected $mCdnMaxageLimit = INF; protected $mPreventClickjacking = TRUE; private $mRevisionId = NULL; private $mRevisionIsCurrent = NULL; private $mRevisionTimestamp = NULL; protected $mFileVersion = NULL; protected $styles = [...]; private $mIndexPolicy = 'index'; private $mFollowPolicy = 'follow'; private $mRobotsOptions = [...]; private $mVaryHeader = [...]; private $mRedirectedFrom = NULL; private $mProperties = [...]; private $mTarget = NULL; private $mEnableTOC = FALSE; private $copyrightUrl = NULL; private $limitReportJSData = [...]; private $contentOverrides = [...]; private $contentOverrideCallbacks = [...]; private $mLinkHeader = [...]; private $CSP = class ContentSecurityPolicy { ... } }; private $user = class User { public $mId = 1; public $mName = 'Reedy'; public $mActorId = 1; public $mRealName = 'Sam'; public $mEmail = 'sam@reedyboy.net'; public $mTouched = '20221019203339'; protected $mQuickTouched = NULL; protected $mToken = 'a47668ca62955a1c7c36284542d16f8d'; public $mEmailAuthenticated = '20220708234337'; protected $mEmailToken = '\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000'; protected $mEmailTokenExpires = NULL; protected $mRegistration = '20110131194049'; protected $mLoadedItems = TRUE; public $mFrom = 'session'; protected $mDatePreference = NULL; private $mBlockedby = -1; protected $mHash = FALSE; protected $mBlockreason = NULL; protected $mGlobalBlock = NULL; protected $mLocked = NULL; private $mHideName = NULL; private $mRequest = class WebRequest { ... }; private $mBlock = NULL; private $mBlockedFromCreateAccount = FALSE; protected $queryFlagsUsed = 0; private $mThisAsAuthority = class MediaWiki\Permissions\UserAuthority { ... }; private $isTemp = FALSE }; private $authority = NULL; private $lang = class Language { public $mCode = 'en-gb'; public $mMagicExtensions = [...]; private $mHtmlCode = NULL; public $dateFormatStrings = [...]; public $mExtendedSpecialPageAliases = [...]; protected $namespaceNames = [...]; protected $mNamespaceIds = NULL; protected $namespaceAliases = NULL; private $transformData = class Wikimedia\DebugInfo\Placeholder { ... }; private $namespaceInfo = class Wikimedia\DebugInfo\Placeholder { ... }; private $localisationCache = class Wikimedia\DebugInfo\Placeholder { ... }; private $langNameUtils = class Wikimedia\DebugInfo\Placeholder { ... }; private $langFallback = class Wikimedia\DebugInfo\Placeholder { ... }; private $grammarTransformCache = NULL; private $converterFactory = class Wikimedia\DebugInfo\Placeholder { ... }; private $hookContainer = class Wikimedia\DebugInfo\Placeholder { ... }; private $hookRunner = class Wikimedia\DebugInfo\Placeholder { ... }; private $config = class Wikimedia\DebugInfo\Placeholder { ... }; private $overrideUcfirstCharacters = NULL }; private $skin = class MediaWiki\Skins\Vector\SkinVectorLegacy { private ${ContextSource}context = ...; private ${Skin}defaultLinkOptions = [...]; protected $skinname = 'vector'; protected $options = [...]; protected $mRelevantTitle = NULL; private ${Skin}mRelevantUser = FALSE; private ${Skin}languageLinks = NULL; private ${Skin}sidebar = NULL; private ${Skin}componentRegistry = class MediaWiki\Skin\SkinComponentRegistry { ... }; public $template = NULL; public $thispage = NULL; public $titletxt = NULL; public $userpage = NULL; public $thisquery = NULL; public $loggedin = NULL; public $username = NULL; public $userpageUrlDetails = NULL; private ${SkinTemplate}isTempUser = NULL; private ${SkinTemplate}isNamedUser = NULL; private ${SkinTemplate}templateContextSet = FALSE; private ${SkinTemplate}contentNavigationCached = NULL; private ${SkinMustache}templateParser = NULL; private ${MediaWiki\Skins\Vector\SkinVector}languages = NULL }; private $timing = NULL; private $config = class GlobalVarConfig { private $prefix = 'wg' }; private $languageRecursion = FALSE }, $including = ???, $linkRenderer = ??? )	.../MediaWiki.php:311
7	0.0452	4876216	SpecialPage->run( $subPage = NULL )	.../SpecialPageFactory.php:1451
8	0.0520	5149472	SpecialBotPasswords->execute( $par = NULL )	.../SpecialPage.php:700
9	0.1148	6704400	trim( $string = NULL )	.../SpecialBotPasswords.php:107

Event Timeline

Code is currently...

		$par = trim( $par );
		if ( strlen( $par ) === 0 ) {
			$par = null;
		}

Doing something like the below (turning it into a string and back to null) seems pointless

		$par = trim( $par ?? '' );
		if ( strlen( $par ) === 0 ) {
			$par = null;
		}

Change 855151 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@master] SpecialBotPasswords: Don't pass null to trim()

https://gerrit.wikimedia.org/r/855151

Change 855151 merged by jenkins-bot:

[mediawiki/core@master] SpecialBotPasswords: Don't pass null to trim()

https://gerrit.wikimedia.org/r/855151

Change 855107 had a related patch set uploaded (by Jforrester; author: Reedy):

[mediawiki/core@REL1_39] SpecialBotPasswords: Don't pass null to trim()

https://gerrit.wikimedia.org/r/855107

Change 855108 had a related patch set uploaded (by Jforrester; author: Reedy):

[mediawiki/core@REL1_38] SpecialBotPasswords: Don't pass null to trim()

https://gerrit.wikimedia.org/r/855108

Reedy claimed this task.

Change 855108 merged by jenkins-bot:

[mediawiki/core@REL1_38] SpecialBotPasswords: Don't pass null to trim()

https://gerrit.wikimedia.org/r/855108

Change 855107 merged by jenkins-bot:

[mediawiki/core@REL1_39] SpecialBotPasswords: Don't pass null to trim()

https://gerrit.wikimedia.org/r/855107