r28417 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r28416‎ | r28417 | r28418 >
Date:19:47, 12 December 2007
Author:aaron
Status:old
Tags:
Comment:
*Rename pt_by to pt_user to be a bit more consistent
*Remove pt_by index (no given or likely good use for it, re-add if there is one and say why)
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/maintenance/archives/patch-protected_titles.sql (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/patch-protected_titles.sql
@@ -2,12 +2,12 @@
33 CREATE TABLE /*$wgDBprefix*/protected_titles (
44 pt_namespace int(11) NOT NULL,
55 pt_title varchar(255) NOT NULL,
6 - pt_by int(10) unsigned NOT NULL,
 6+ pt_user int(10) unsigned NOT NULL,
77 pt_reason tinyblob,
88 pt_timestamp binary(14) NOT NULL,
99 pt_expiry varbinary(14) NOT NULL default '',
1010 pt_create_perm varbinary(60) NOT NULL,
1111 PRIMARY KEY (pt_namespace,pt_title),
12 - KEY `pt_by` (pt_by),
 12+
1313 KEY pt_timestamp (pt_timestamp)
1414 ) /*$wgDBTableOptions*/;
\ No newline at end of file
Index: trunk/phase3/includes/Title.php
@@ -1206,7 +1206,7 @@
12071207 $pt_create_perm = 'protect';
12081208
12091209 if ($pt_create_perm == '' || !$user->isAllowed($pt_create_perm)) {
1210 - $errors[] = array ( 'titleprotected', User::whoIs($pt_by), $pt_reason );
 1210+ $errors[] = array ( 'titleprotected', User::whoIs($pt_user), $pt_reason );
12111211 }
12121212 }
12131213 }
@@ -1295,7 +1295,7 @@
12961296 , 'pt_create_perm' => $create_perm
12971297 , 'pt_timestamp' => Block::encodeExpiry(wfTimestampNow(), $dbw)
12981298 , 'pt_expiry' => $encodedExpiry
1299 - , 'pt_by' => $wgUser->getId(), 'pt_reason' => $reason ), __METHOD__ );
 1299+ , 'pt_user' => $wgUser->getId(), 'pt_reason' => $reason ), __METHOD__ );
13001300 } else {
13011301 $dbw->delete( 'protected_titles', array( 'pt_namespace' => $namespace,
13021302 'pt_title' => $title ), __METHOD__ );

Follow-up revisions

RevisionCommit summaryAuthorDate
r28570(bug 12314) r28417 kind of left out tables.sql . . . changed pt_by to pt_user...simetrical21:27, 16 December 2007

Status & tagging log