summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialChangePassword.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialChangePassword.php')
-rw-r--r--includes/specials/SpecialChangePassword.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/specials/SpecialChangePassword.php b/includes/specials/SpecialChangePassword.php
index 168095f8..6a4347df 100644
--- a/includes/specials/SpecialChangePassword.php
+++ b/includes/specials/SpecialChangePassword.php
@@ -179,7 +179,8 @@ class SpecialChangePassword extends FormSpecialPage {
}
if ( $request->getCheck( 'wpCancel' ) ) {
- $titleObj = Title::newFromText( $request->getVal( 'returnto' ) );
+ $returnto = $request->getVal( 'returnto' );
+ $titleObj = $returnto !== null ? Title::newFromText( $returnto ) : null;
if ( !$titleObj instanceof Title ) {
$titleObj = Title::newMainPage();
}