From: Fomafix Date: Mon, 20 Aug 2018 19:12:35 +0000 (+0200) Subject: EditPage: Allow summary=0 in URL parameter X-Git-Tag: 1.34.0-rc.0~4252^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=a4c791b7201a31df95b79905251e2f4298ff8529;p=lhc%2Fweb%2Fwiklou.git EditPage: Allow summary=0 in URL parameter In PHP is '0' == false. Bug: T202317 Change-Id: I855c6297750f7d989e69ed492f8e522e540a6a9c --- 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 ) );