dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
be72d62
)
Show expiry time in the null revision inserted on protection with an expiry date.
author
Andrew Garrett
<werdna@users.mediawiki.org>
Tue, 23 Jan 2007 10:51:33 +0000
(10:51 +0000)
committer
Andrew Garrett
<werdna@users.mediawiki.org>
Tue, 23 Jan 2007 10:51:33 +0000
(10:51 +0000)
includes/Article.php
patch
|
blob
|
history
diff --git
a/includes/Article.php
b/includes/Article.php
index
122558b
..
93cb029
100644
(file)
--- a/
includes/Article.php
+++ b/
includes/Article.php
@@
-1686,19
+1686,29
@@
class Article {
$dbw = wfGetDB( DB_MASTER );
$dbw = wfGetDB( DB_MASTER );
+ $encodedExpiry = Block::encodeExpiry($expiry, $dbw );
+
+ $expiry_description = '';
+
+ if ( $encodedExpiry != 'infinity' ) {
+ $expiry_description = ' (' . wfMsgForContent( 'protect-expiring', $wgContLang->timeanddate( $expiry ) ).')';
+ }
+
# Prepare a null revision to be added to the history
$comment = $wgContLang->ucfirst( wfMsgForContent( $protect ? 'protectedarticle' : 'unprotectedarticle', $this->mTitle->getPrefixedText() ) );
# Prepare a null revision to be added to the history
$comment = $wgContLang->ucfirst( wfMsgForContent( $protect ? 'protectedarticle' : 'unprotectedarticle', $this->mTitle->getPrefixedText() ) );
+
if( $reason )
$comment .= ": $reason";
if( $protect )
$comment .= " [$updated]";
if( $reason )
$comment .= ": $reason";
if( $protect )
$comment .= " [$updated]";
+ if ( $expiry_description && $protect )
+ $comment .= "$expiry_description";
+
$nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true );
$nullRevId = $nullRevision->insertOn( $dbw );
# Update restrictions table
foreach( $limit as $action => $restrictions ) {
$nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true );
$nullRevId = $nullRevision->insertOn( $dbw );
# Update restrictions table
foreach( $limit as $action => $restrictions ) {
- $encodedExpiry = Block::encodeExpiry($expiry, $dbw );
-
if ($restrictions != '' ) {
$dbw->replace( 'page_restrictions', array( 'pr_pagetype'),
array( 'pr_page' => $id, 'pr_type' => $action
if ($restrictions != '' ) {
$dbw->replace( 'page_restrictions', array( 'pr_pagetype'),
array( 'pr_page' => $id, 'pr_type' => $action
@@
-1726,16
+1736,11
@@
class Article {
$log = new LogPage( 'protect' );
$cascade_description = '';
$log = new LogPage( 'protect' );
$cascade_description = '';
- $expiry_description = '';
if ($cascade) {
$cascade_description = ' ['.wfMsg('protect-summary-cascade').']';
}
if ($cascade) {
$cascade_description = ' ['.wfMsg('protect-summary-cascade').']';
}
- if ( $encodedExpiry != 'infinity' ) {
- $expiry_description = ' (' . wfMsgForContent( 'protect-expiring', $wgContLang->timeanddate( $expiry ) ).')';
- }
-
if( $protect ) {
$log->addEntry( 'protect', $this->mTitle, trim( $reason . " [$updated]$cascade_description$expiry_description" ) );
} else {
if( $protect ) {
$log->addEntry( 'protect', $this->mTitle, trim( $reason . " [$updated]$cascade_description$expiry_description" ) );
} else {