X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiEditPage.php;h=3f63a0085afba89d7b02186fa6dd321e0c981ad0;hb=529fc12d2ad2032337594389448fdb5b55802830;hp=d0a0523bf7c83444174ca38edc7d5ed141e7547f;hpb=5d4d405c0765952928727ad1f2731dfbceedd4fe;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index d0a0523bf7..3f63a0085a 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -20,6 +20,8 @@ * @file */ +use MediaWiki\Storage\RevisionRecord; + /** * A module that allows for editing and creating pages. * @@ -52,7 +54,7 @@ class ApiEditPage extends ApiBase { $oldTitle = $titleObj; $titles = Revision::newFromTitle( $oldTitle, false, Revision::READ_LATEST ) - ->getContent( Revision::FOR_THIS_USER, $user ) + ->getContent( RevisionRecord::FOR_THIS_USER, $user ) ->getRedirectChain(); // array_shift( $titles ); @@ -193,14 +195,14 @@ class ApiEditPage extends ApiBase { $undoafterRev = Revision::newFromId( $params['undoafter'] ); } $undoRev = Revision::newFromId( $params['undo'] ); - if ( is_null( $undoRev ) || $undoRev->isDeleted( Revision::DELETED_TEXT ) ) { + if ( is_null( $undoRev ) || $undoRev->isDeleted( RevisionRecord::DELETED_TEXT ) ) { $this->dieWithError( [ 'apierror-nosuchrevid', $params['undo'] ] ); } if ( $params['undoafter'] == 0 ) { $undoafterRev = $undoRev->getPrevious(); } - if ( is_null( $undoafterRev ) || $undoafterRev->isDeleted( Revision::DELETED_TEXT ) ) { + if ( is_null( $undoafterRev ) || $undoafterRev->isDeleted( RevisionRecord::DELETED_TEXT ) ) { $this->dieWithError( [ 'apierror-nosuchrevid', $params['undoafter'] ] ); } @@ -367,21 +369,6 @@ class ApiEditPage extends ApiBase { $ep->importFormData( $req ); $content = $ep->textbox1; - // Run hooks - // Handle APIEditBeforeSave parameters - $r = []; - // Deprecated in favour of EditFilterMergedContent - if ( !Hooks::run( 'APIEditBeforeSave', [ $ep, $content, &$r ], '1.28' ) ) { - if ( count( $r ) ) { - $r['result'] = 'Failure'; - $apiResult->addValue( null, $this->getModuleName(), $r ); - - return; - } - - $this->dieWithError( 'hookaborted' ); - } - // Do the actual save $oldRevId = $articleObject->getRevIdFetched(); $result = null;