From a4c791b7201a31df95b79905251e2f4298ff8529 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Mon, 20 Aug 2018 21:12:35 +0200 Subject: [PATCH] EditPage: Allow summary=0 in URL parameter In PHP is '0' == false. Bug: T202317 Change-Id: I855c6297750f7d989e69ed492f8e522e540a6a9c --- includes/EditPage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index d1f874ead7..2491cb1800 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1055,7 +1055,7 @@ class EditPage { $this->sectiontitle = $request->getVal( 'preloadtitle' ); // Once wpSummary isn't being use for setting section titles, we should delete this. $this->summary = $request->getVal( 'preloadtitle' ); - } elseif ( $this->section != 'new' && $request->getVal( 'summary' ) ) { + } elseif ( $this->section != 'new' && $request->getVal( 'summary' ) !== '' ) { $this->summary = $request->getText( 'summary' ); if ( $this->summary !== '' ) { $this->hasPresetSummary = true; @@ -2861,7 +2861,7 @@ ERROR; $this->autoSumm = md5( '' ); } - $autosumm = $this->autoSumm ?: md5( $this->summary ); + $autosumm = $this->autoSumm !== '' ? $this->autoSumm : md5( $this->summary ); $out->addHTML( Html::hidden( 'wpAutoSummary', $autosumm ) ); $out->addHTML( Html::hidden( 'oldid', $this->oldid ) ); -- 2.20.1