X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMovePage.php;h=d17f23422dc9557cd0ad2bf12b772cbbe7fdaac3;hb=65054c94c2617a2d337344633b508ed510eb2885;hp=bc3305ab0482e727d6c630a4584d9add3b7ad3da;hpb=b563ca96845c935d2ca734381c71e4dfb5cd9370;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MovePage.php b/includes/MovePage.php index bc3305ab04..d17f23422d 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -297,19 +297,25 @@ class MovePage { if ( $protected ) { # Protect the redirect title as the title used to be... - $dbw->insertSelect( 'page_restrictions', 'page_restrictions', - [ - 'pr_page' => $redirid, - 'pr_type' => 'pr_type', - 'pr_level' => 'pr_level', - 'pr_cascade' => 'pr_cascade', - 'pr_user' => 'pr_user', - 'pr_expiry' => 'pr_expiry' - ], + $res = $dbw->select( + 'page_restrictions', + '*', [ 'pr_page' => $pageid ], __METHOD__, - [ 'IGNORE' ] + 'FOR UPDATE' ); + $rowsInsert = []; + foreach ( $res as $row ) { + $rowsInsert[] = [ + 'pr_page' => $redirid, + 'pr_type' => $row->pr_type, + 'pr_level' => $row->pr_level, + 'pr_cascade' => $row->pr_cascade, + 'pr_user' => $row->pr_user, + 'pr_expiry' => $row->pr_expiry + ]; + } + $dbw->insert( 'page_restrictions', $rowsInsert, __METHOD__, [ 'IGNORE' ] ); // Build comment for log $comment = wfMessage(