Swap ternary check for if statement

isset is not needed to check for null
and if is used, because the else branch is not needed

Change-Id: I3069ac43911101aa500c4897d419dca68f968040
This commit is contained in:
Umherirrender 2019-03-12 20:08:56 +01:00
parent 40cc11817a
commit 9bc797453e

View file

@ -593,7 +593,9 @@ class SimpleCaptcha {
}
} else {
// Get link changes in the slowest way known to man
$oldtext = isset( $oldtext ) ? $oldtext : $this->loadText( $title, $section );
if ( $oldtext === null ) {
$oldtext = $this->loadText( $title, $section );
}
$oldLinks = $this->findLinks( $title, $oldtext );
$newLinks = $this->findLinks( $title, $newtext );
}
@ -621,7 +623,9 @@ class SimpleCaptcha {
);
}
// Custom regex checks. Reuse $oldtext if set above.
$oldtext = isset( $oldtext ) ? $oldtext : $this->loadText( $title, $section );
if ( $oldtext === null ) {
$oldtext = $this->loadText( $title, $section );
}
foreach ( $wgCaptchaRegexes as $regex ) {
$newMatches = [];