X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FWikiPage.php;h=9507e5fcf45755cad693339a047adf1acf68c170;hb=3d87e3a86bcb39d444ef916129dd48bf80b5bb31;hp=6c2c6ad8814890dea4cd64f002136a8f0e56a875;hpb=91f29bf1b624151a79a906ccfb7edd73bff1839a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 6c2c6ad881..9507e5fcf4 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -2247,7 +2247,7 @@ class WikiPage implements Page, IDBAccessObject { * @return Status */ public function doUpdateRestrictions( array $limit, array $expiry, &$cascade, $reason, User $user ) { - global $wgCascadingRestrictionLevels; + global $wgCascadingRestrictionLevels, $wgContLang; if ( wfReadOnly() ) { return Status::newFatal( 'readonlytext', wfReadOnlyReason() ); @@ -2320,6 +2320,9 @@ class WikiPage implements Page, IDBAccessObject { $logAction = 'protect'; } + // Truncate for whole multibyte characters + $reason = $wgContLang->truncate( $reason, 255 ); + if ( $id ) { // Protection of existing page if ( !wfRunHooks( 'ArticleProtect', array( &$this, &$user, $limit, $reason ) ) ) { return Status::newGood(); @@ -2393,7 +2396,7 @@ class WikiPage implements Page, IDBAccessObject { 'pt_namespace' => $this->mTitle->getNamespace(), 'pt_title' => $this->mTitle->getDBkey(), 'pt_create_perm' => $limit['create'], - 'pt_timestamp' => $dbw->encodeExpiry( wfTimestampNow() ), + 'pt_timestamp' => $dbw->timestamp(), 'pt_expiry' => $dbw->encodeExpiry( $expiry['create'] ), 'pt_user' => $user->getId(), 'pt_reason' => $reason, @@ -2421,7 +2424,7 @@ class WikiPage implements Page, IDBAccessObject { // Update the protection log $log = new LogPage( 'protect' ); - $log->addEntry( $logAction, $this->mTitle, trim( $reason ), $params, $user ); + $log->addEntry( $logAction, $this->mTitle, $reason, $params, $user ); return Status::newGood(); }