r104051 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104050‎ | r104051 | r104052 >
Date:17:14, 23 November 2011
Author:demon
Status:ok (Comments)
Tags:historical 
Comment:
(bug 29475) Remove "trackback" feature entirely from core. This has been disabled-by-default since its inception and nobody uses it.

If someone really really wants this, they can write an extension.

Language files need rebuilding, but I took care of En and messages.inc.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/FakeTitle.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/SkinLegacy.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/WikiPage.php (modified) (history)
  • /trunk/phase3/includes/actions/DeletetrackbackAction.php (deleted) (history)
  • /trunk/phase3/includes/installer/MysqlUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/PostgresUpdater.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/archives/patch-trackbacks.sql (deleted) (history)
  • /trunk/phase3/maintenance/fuzz-tester.php (modified) (history)
  • /trunk/phase3/maintenance/ibm_db2/foreignkeys.sql (modified) (history)
  • /trunk/phase3/maintenance/ibm_db2/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/language/messageTypes.inc (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)
  • /trunk/phase3/maintenance/mssql/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/oracle/archives/patch_fk_rename_deferred.sql (modified) (history)
  • /trunk/phase3/maintenance/oracle/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/postgres/mediawiki_mysql2postgres.pl (modified) (history)
  • /trunk/phase3/maintenance/postgres/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/sqlite/archives/initial-indexes.sql (modified) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)
  • /trunk/phase3/trackback.php (deleted) (history)
  • /trunk/phase3/trackback.php5 (deleted) (history)

Diff [purge]

Index: trunk/phase3/trackback.php5
@@ -1 +0,0 @@
2 -<?php require './trackback.php';
\ No newline at end of file
Index: trunk/phase3/trackback.php
@@ -1,92 +0,0 @@
2 -<?php
3 -/**
4 - * Provide functions to handle article trackbacks.
5 - * @file
6 - * @ingroup SpecialPage
7 - */
8 -
9 -if ( isset( $_SERVER['MW_COMPILED'] ) ) {
10 - require ( 'phase3/includes/WebStart.php' );
11 -} else {
12 - require ( dirname( __FILE__ ) . '/includes/WebStart.php' );
13 -}
14 -
15 -class TrackBack {
16 -
17 - private $r, $url, $title = null;
18 -
19 - private function XMLsuccess() {
20 - header( "Content-Type: application/xml; charset=utf-8" );
21 - echo <<<XML
22 -<?xml version="1.0" encoding="utf-8"?>
23 -<response>
24 - <error>0</error>
25 -</response>
26 -XML;
27 - exit;
28 - }
29 -
30 - /**
31 - * @param $err string
32 - */
33 - private function XMLerror( $err = "Invalid request." ) {
34 - header( "HTTP/1.0 400 Bad Request" );
35 - header( "Content-Type: application/xml; charset=utf-8" );
36 - echo <<<XML
37 -<?xml version="1.0" encoding="utf-8"?>
38 -<response>
39 - <error>1</error>
40 - <message>Invalid request: $err</message>
41 -</response>
42 -XML;
43 - exit;
44 - }
45 -
46 - public function __construct() {
47 - global $wgUseTrackbacks, $wgRequest;
48 -
49 - if( !$wgUseTrackbacks )
50 - $this->XMLerror( "Trackbacks are disabled" );
51 -
52 - $this->r = $wgRequest;
53 -
54 - if( !$this->r->wasPosted() ) {
55 - $this->XMLerror( "Must be posted" );
56 - }
57 -
58 - $this->url = $wgRequest->getText( 'url' );
59 - $article = $wgRequest->getText( 'article' );
60 -
61 - if( !$this->url || !$article ) {
62 - $this->XMLerror( "Required field not specified" );
63 - }
64 -
65 - $this->title = Title::newFromText( $article );
66 - if( !$this->title || !$this->title->exists() ) {
67 - $this->XMLerror( "Specified article does not exist." );
68 - }
69 - }
70 -
71 - public function write() {
72 - $dbw = wfGetDB( DB_MASTER );
73 -
74 - $tbtitle = $this->r->getText( 'title' );
75 - $tbex = $this->r->getText( 'excerpt' );
76 - $tbname = $this->r->getText( 'blog_name' );
77 -
78 - $dbw->insert('trackbacks', array(
79 - 'tb_page' => $this->title->getArticleID(),
80 - 'tb_title' => $tbtitle,
81 - 'tb_url' => $this->url,
82 - 'tb_ex' => $tbex,
83 - 'tb_name' => $tbname
84 - ));
85 -
86 - $dbw->commit();
87 -
88 - $this->XMLsuccess();
89 - }
90 -}
91 -
92 -$tb = new TrackBack();
93 -$tb->write();
Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -156,6 +156,7 @@
157157 * (bug 29747) eAccelerator shared memory caching has been removed since it is
158158 now disabled by default and is buggy. APC, XCache and WinCache are not affected.
159159 * Installer now refuses to install if php was not compiled with Ctype support.
 160+* (bug 29475) Remove "trackback" feature entirely from core
160161
161162 === API changes in 1.19 ===
162163 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1975,7 +1975,6 @@
19761976 'right-autopatrol' => "Have one's own edits automatically marked as patrolled",
19771977 'right-patrolmarks' => 'View recent changes patrol marks',
19781978 'right-unwatchedpages' => 'View a list of unwatched pages',
1979 -'right-trackback' => 'Submit a trackback',
19801979 'right-mergehistory' => 'Merge the history of pages',
19811980 'right-userrights' => 'Edit all user rights',
19821981 'right-userrights-interwiki' => 'Edit user rights of users on other wikis',
@@ -2022,7 +2021,6 @@
20232022 'action-patrol' => "mark others' edit as patrolled",
20242023 'action-autopatrol' => 'have your edit marked as patrolled',
20252024 'action-unwatchedpages' => 'view the list of unwatched pages',
2026 -'action-trackback' => 'submit a trackback',
20272025 'action-mergehistory' => 'merge the history of this page',
20282026 'action-userrights' => 'edit all user rights',
20292027 'action-userrights-interwiki' => 'edit user rights of users on other wikis',
@@ -4273,15 +4271,6 @@
42744272 'scarytranscludefailed' => '[Template fetch failed for $1]',
42754273 'scarytranscludetoolong' => '[URL is too long]',
42764274
4277 -# Trackbacks
4278 -'trackbackbox' => 'Trackbacks for this page:<br />
4279 -$1',
4280 -'trackback' => '; $4 $5: [$2 $1]', # only translate this message to other languages if you have to change it
4281 -'trackbackexcerpt' => '; $4 $5: [$2 $1]: <nowiki>$3</nowiki>', # only translate this message to other languages if you have to change it
4282 -'trackbackremove' => '([$1 Delete])',
4283 -'trackbacklink' => 'Trackback',
4284 -'trackbackdeleteok' => 'The trackback was successfully deleted.',
4285 -
42864275 # Delete conflict
42874276 'deletedwhileediting' => "'''Warning''': This page was deleted after you started editing!",
42884277 'confirmrecreate' => "User [[User:$1|$1]] ([[User talk:$1|talk]]) deleted this page after you started editing with reason:
Index: trunk/phase3/includes/AutoLoader.php
@@ -255,7 +255,6 @@
256256
257257 # includes/actions
258258 'CreditsAction' => 'includes/actions/CreditsAction.php',
259 - 'DeletetrackbackAction' => 'includes/actions/DeletetrackbackAction.php',
260259 'HistoryAction' => 'includes/actions/HistoryAction.php',
261260 'HistoryPage' => 'includes/actions/HistoryAction.php',
262261 'HistoryPager' => 'includes/actions/HistoryAction.php',
Index: trunk/phase3/includes/actions/DeletetrackbackAction.php
@@ -1,54 +0,0 @@
2 -<?php
3 -/**
4 - * Delete a trackback on a page
5 - *
6 - * Copyright © 2011 Alexandre Emsenhuber
7 - *
8 - * This program is free software; you can redistribute it and/or modify
9 - * it under the terms of the GNU General Public License as published by
10 - * the Free Software Foundation; either version 2 of the License, or
11 - * (at your option) any later version.
12 - *
13 - * This program is distributed in the hope that it will be useful,
14 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 - * GNU General Public License for more details.
17 - *
18 - * You should have received a copy of the GNU General Public License
19 - * along with this program; if not, write to the Free Software
20 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 - *
22 - * @file
23 - * @ingroup Actions
24 - */
25 -
26 -class DeletetrackbackAction extends FormlessAction {
27 -
28 - public function getName() {
29 - return 'deletetrackback';
30 - }
31 -
32 - public function getRestriction() {
33 - return 'delete';
34 - }
35 -
36 - protected function getDescription() {
37 - return '';
38 - }
39 -
40 - protected function checkCanExecute( User $user ) {
41 - if ( !$user->matchEditToken( $this->getRequest()->getVal( 'token' ) ) ) {
42 - throw new ErrorPageError( 'sessionfailure-title', 'sessionfailure' );
43 - }
44 -
45 - return parent::checkCanExecute( $user );
46 - }
47 -
48 - public function onView() {
49 - $db = wfGetDB( DB_MASTER );
50 - $db->delete( 'trackbacks', array( 'tb_id' => $this->getRequest()->getInt( 'tbid' ) ) );
51 -
52 - $this->getOutput()->addWikiMsg( 'trackbackdeleteok' );
53 - $this->getTitle()->invalidateCache();
54 - }
55 -}
Index: trunk/phase3/includes/SkinLegacy.php
@@ -284,7 +284,7 @@
285285 }
286286
287287 function bottomLinks() {
288 - global $wgOut, $wgUser, $wgUseTrackbacks;
 288+ global $wgOut, $wgUser;
289289 $sep = wfMsgExt( 'pipe-separator', 'escapenoentities' ) . "\n";
290290
291291 $s = '';
@@ -300,10 +300,6 @@
301301 $element[] = $this->whatLinksHere();
302302 $element[] = $this->watchPageLinksLink();
303303
304 - if ( $wgUseTrackbacks ) {
305 - $element[] = $this->trackbackLink();
306 - }
307 -
308304 $title = $this->getSkin()->getTitle();
309305
310306 if (
@@ -709,11 +705,6 @@
710706 }
711707 }
712708
713 - function trackbackLink() {
714 - return '<a href="' . $this->getSkin()->getTitle()->trackbackURL() . '">'
715 - . wfMsg( 'trackbacklink' ) . '</a>';
716 - }
717 -
718709 function talkLink() {
719710 $title = $this->getSkin()->getTitle();
720711 if ( NS_SPECIAL == $title->getNamespace() ) {
Index: trunk/phase3/includes/FakeTitle.php
@@ -112,8 +112,6 @@
113113 function touchLinks() { $this->error(); }
114114 function getTouched( $db = null ) { $this->error(); }
115115 function getNotificationTimestamp( $user = null ) { $this->error(); }
116 - function trackbackURL() { $this->error(); }
117 - function trackbackRDF() { $this->error(); }
118116 function getNamespaceKey( $prepend = 'nstab-' ) { $this->error(); }
119117 function isSpecialPage() { $this->error(); }
120118 function isSpecial( $name ) { $this->error(); }
Index: trunk/phase3/includes/Article.php
@@ -857,7 +857,7 @@
858858 * Show the footer section of an ordinary page view
859859 */
860860 public function showViewFooter() {
861 - global $wgOut, $wgUseTrackbacks;
 861+ global $wgOut;
862862
863863 # check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page
864864 if ( $this->getTitle()->getNamespace() == NS_USER_TALK && IP::isValid( $this->getTitle()->getText() ) ) {
@@ -868,11 +868,6 @@
869869 # chance to mark this new article as patrolled.
870870 $this->showPatrolFooter();
871871
872 - # Trackbacks
873 - if ( $wgUseTrackbacks ) {
874 - $this->addTrackbacks();
875 - }
876 -
877872 wfRunHooks( 'ArticleViewFooter', array( $this ) );
878873
879874 }
@@ -1221,46 +1216,6 @@
12221217 }
12231218
12241219 /**
1225 - * Builds trackback links for article display if $wgUseTrackbacks is set to true
1226 - */
1227 - public function addTrackbacks() {
1228 - global $wgOut;
1229 -
1230 - $dbr = wfGetDB( DB_SLAVE );
1231 - $tbs = $dbr->select( 'trackbacks',
1232 - array( 'tb_id', 'tb_title', 'tb_url', 'tb_ex', 'tb_name' ),
1233 - array( 'tb_page' => $this->mPage->getID() )
1234 - );
1235 -
1236 - if ( !$dbr->numRows( $tbs ) ) {
1237 - return;
1238 - }
1239 -
1240 - $wgOut->preventClickjacking();
1241 -
1242 - $tbtext = "";
1243 - foreach ( $tbs as $o ) {
1244 - $rmvtxt = "";
1245 -
1246 - if ( $this->getContext()->getUser()->isAllowed( 'trackback' ) ) {
1247 - $delurl = $this->getTitle()->getFullURL( "action=deletetrackback&tbid=" .
1248 - $o->tb_id . "&token=" . urlencode( $this->getContext()->getUser()->getEditToken() ) );
1249 - $rmvtxt = wfMsg( 'trackbackremove', htmlspecialchars( $delurl ) );
1250 - }
1251 -
1252 - $tbtext .= "\n";
1253 - $tbtext .= wfMsgNoTrans( strlen( $o->tb_ex ) ? 'trackbackexcerpt' : 'trackback',
1254 - $o->tb_title,
1255 - $o->tb_url,
1256 - $o->tb_ex,
1257 - $o->tb_name,
1258 - $rmvtxt );
1259 - }
1260 -
1261 - $wgOut->wrapWikiMsg( "<div id='mw_trackbacks'>\n$1\n</div>\n", array( 'trackbackbox', $tbtext ) );
1262 - }
1263 -
1264 - /**
12651220 * Handle action=render
12661221 */
12671222 public function render() {
@@ -1657,14 +1612,6 @@
16581613 }
16591614
16601615 /**
1661 - * Removes trackback record for current article from trackbacks table
1662 - * @deprecated since 1.18
1663 - */
1664 - public function deletetrackback() {
1665 - return Action::factory( 'deletetrackback', $this )->show();
1666 - }
1667 -
1668 - /**
16691616 * Info about this page
16701617 * @deprecated since 1.19
16711618 */
Index: trunk/phase3/includes/installer/MysqlUpdater.php
@@ -66,7 +66,6 @@
6767 array( 'addTable', 'user_newtalk', 'patch-usernewtalk2.sql' ),
6868 array( 'addTable', 'transcache', 'patch-transcache.sql' ),
6969 array( 'addField', 'interwiki', 'iw_trans', 'patch-interwiki-trans.sql' ),
70 - array( 'addTable', 'trackbacks', 'patch-trackbacks.sql' ),
7170
7271 // 1.6
7372 array( 'doWatchlistNull' ),
Index: trunk/phase3/includes/installer/PostgresUpdater.php
@@ -216,7 +216,6 @@
217217 array( 'changeFkeyDeferrable', 'revision', 'rev_page', 'page (page_id) ON DELETE CASCADE' ),
218218 array( 'changeFkeyDeferrable', 'revision', 'rev_user', 'mwuser(user_id) ON DELETE RESTRICT' ),
219219 array( 'changeFkeyDeferrable', 'templatelinks', 'tl_from', 'page(page_id) ON DELETE CASCADE' ),
220 - array( 'changeFkeyDeferrable', 'trackbacks', 'tb_page', 'page(page_id) ON DELETE CASCADE' ),
221220 array( 'changeFkeyDeferrable', 'user_groups', 'ug_user', 'mwuser(user_id) ON DELETE CASCADE' ),
222221 array( 'changeFkeyDeferrable', 'user_newtalk', 'user_id', 'mwuser(user_id) ON DELETE CASCADE' ),
223222 array( 'changeFkeyDeferrable', 'user_properties', 'up_user', 'mwuser(user_id) ON DELETE CASCADE' ),
Index: trunk/phase3/includes/SkinTemplate.php
@@ -139,7 +139,7 @@
140140 global $wgDisableCounters, $wgSitename, $wgLogo, $wgHideInterlanguageLinks;
141141 global $wgMaxCredits, $wgShowCreditsIfMax;
142142 global $wgPageShowWatchingUsers;
143 - global $wgUseTrackbacks, $wgUseSiteJs, $wgDebugComments;
 143+ global $wgUseSiteJs, $wgDebugComments;
144144 global $wgArticlePath, $wgScriptPath, $wgServer;
145145
146146 wfProfileIn( __METHOD__ );
@@ -215,13 +215,6 @@
216216 $tpl->set( 'html5version', $wgHtml5Version );
217217 $tpl->set( 'headlinks', $out->getHeadLinks() );
218218 $tpl->set( 'csslinks', $out->buildCssLinks() );
219 -
220 - if( $wgUseTrackbacks && $out->isArticleRelated() ) {
221 - $tpl->set( 'trackbackhtml', $out->getTitle()->trackbackRDF() );
222 - } else {
223 - $tpl->set( 'trackbackhtml', null );
224 - }
225 -
226219 $tpl->set( 'pageclass', $this->getPageClasses( $this->getTitle() ) );
227220 $tpl->set( 'skinnameclass', ( 'skin-' . Sanitizer::escapeClass( $this->getSkinName() ) ) );
228221 }
@@ -1120,7 +1113,6 @@
11211114 * @private
11221115 */
11231116 protected function buildNavUrls() {
1124 - global $wgUseTrackbacks;
11251117 global $wgUploadNavigationUrl;
11261118
11271119 wfProfileIn( __METHOD__ );
@@ -1143,7 +1135,6 @@
11441136 $nav_urls['permalink'] = false;
11451137 $nav_urls['whatlinkshere'] = false;
11461138 $nav_urls['recentchangeslinked'] = false;
1147 - $nav_urls['trackbacklink'] = false;
11481139 $nav_urls['contributions'] = false;
11491140 $nav_urls['log'] = false;
11501141 $nav_urls['blockip'] = false;
@@ -1183,11 +1174,6 @@
11841175 'href' => SpecialPage::getTitleFor( 'Recentchangeslinked', $this->thispage )->getLocalUrl()
11851176 );
11861177 }
1187 - if ( $wgUseTrackbacks ) {
1188 - $nav_urls['trackbacklink'] = array(
1189 - 'href' => $out->getTitle()->trackbackURL()
1190 - );
1191 - }
11921178 }
11931179
11941180 $user = $this->getRelevantUser();
@@ -1420,10 +1406,6 @@
14211407 $toolbox['recentchangeslinked']['msg'] = 'recentchangeslinked-toolbox';
14221408 $toolbox['recentchangeslinked']['id'] = 't-recentchangeslinked';
14231409 }
1424 - if ( isset( $this->data['nav_urls']['trackbacklink'] ) && $this->data['nav_urls']['trackbacklink'] ) {
1425 - $toolbox['trackbacklink'] = $this->data['nav_urls']['trackbacklink'];
1426 - $toolbox['trackbacklink']['id'] = 't-trackbacklink';
1427 - }
14281410 if ( isset( $this->data['feeds'] ) && $this->data['feeds'] ) {
14291411 $toolbox['feeds']['id'] = 'feedlinks';
14301412 $toolbox['feeds']['links'] = array();
Index: trunk/phase3/includes/Title.php
@@ -3434,10 +3434,7 @@
34353435 $dbw->delete( 'page', array( 'page_id' => $newid ), __METHOD__ );
34363436 if ( !$dbw->cascadingDeletes() ) {
34373437 $dbw->delete( 'revision', array( 'rev_page' => $newid ), __METHOD__ );
3438 - global $wgUseTrackbacks;
3439 - if ( $wgUseTrackbacks ) {
3440 - $dbw->delete( 'trackbacks', array( 'tb_page' => $newid ), __METHOD__ );
3441 - }
 3438+
34423439 $dbw->delete( 'pagelinks', array( 'pl_from' => $newid ), __METHOD__ );
34433440 $dbw->delete( 'imagelinks', array( 'il_from' => $newid ), __METHOD__ );
34443441 $dbw->delete( 'categorylinks', array( 'cl_from' => $newid ), __METHOD__ );
@@ -4147,46 +4144,6 @@
41484145 }
41494146
41504147 /**
4151 - * Get the trackback URL for this page
4152 - *
4153 - * @return String Trackback URL
4154 - */
4155 - public function trackbackURL() {
4156 - global $wgScriptPath, $wgServer, $wgScriptExtension;
4157 -
4158 - return "$wgServer$wgScriptPath/trackback$wgScriptExtension?article="
4159 - . htmlspecialchars( urlencode( $this->getPrefixedDBkey() ) );
4160 - }
4161 -
4162 - /**
4163 - * Get the trackback RDF for this page
4164 - *
4165 - * @return String Trackback RDF
4166 - */
4167 - public function trackbackRDF() {
4168 - $url = htmlspecialchars( $this->getFullURL() );
4169 - $title = htmlspecialchars( $this->getText() );
4170 - $tburl = $this->trackbackURL();
4171 -
4172 - // Autodiscovery RDF is placed in comments so HTML validator
4173 - // won't barf. This is a rather icky workaround, but seems
4174 - // frequently used by this kind of RDF thingy.
4175 - //
4176 - // Spec: http://www.sixapart.com/pronet/docs/trackback_spec
4177 - return "<!--
4178 -<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"
4179 - xmlns:dc=\"http://purl.org/dc/elements/1.1/\"
4180 - xmlns:trackback=\"http://madskills.com/public/xml/rss/module/trackback/\">
4181 -<rdf:Description
4182 - rdf:about=\"$url\"
4183 - dc:identifier=\"$url\"
4184 - dc:title=\"$title\"
4185 - trackback:ping=\"$tburl\" />
4186 -</rdf:RDF>
4187 - }
4188 -
4189 - /**
41904148 * Generate strings used for xml 'id' names in monobook tabs
41914149 *
41924150 * @param $prepend string defaults to 'nstab-'
Index: trunk/phase3/includes/DefaultSettings.php
@@ -3472,7 +3472,6 @@
34733473 $wgGroupPermissions['sysop']['unblockself'] = true;
34743474 $wgGroupPermissions['sysop']['suppressredirect'] = true;
34753475 #$wgGroupPermissions['sysop']['mergehistory'] = true;
3476 -#$wgGroupPermissions['sysop']['trackback'] = true;
34773476
34783477 // Permission to change users' group assignments
34793478 $wgGroupPermissions['bureaucrat']['userrights'] = true;
@@ -4125,14 +4124,6 @@
41264125 $wgDisableCounters = false;
41274126
41284127 /**
4129 - * Support blog-style "trackbacks" for articles. See
4130 - * http://www.sixapart.com/pronet/docs/trackback_spec for details.
4131 - *
4132 - * If enabling this, you also need to grant the 'trackback' right to a group
4133 - */
4134 -$wgUseTrackbacks = false;
4135 -
4136 -/**
41374128 * Parser test suite files to be run by parserTests.php when no specific
41384129 * filename is passed to it.
41394130 *
@@ -5250,7 +5241,6 @@
52515242 */
52525243 $wgActions = array(
52535244 'credits' => true,
5254 - 'deletetrackback' => true,
52555245 'history' => true,
52565246 'info' => true,
52575247 'markpatrolled' => true,
Index: trunk/phase3/includes/User.php
@@ -148,7 +148,6 @@
149149 'suppressionlog',
150150 'suppressredirect',
151151 'suppressrevision',
152 - 'trackback',
153152 'unblockself',
154153 'undelete',
155154 'unwatchedpages',
Index: trunk/phase3/includes/OutputPage.php
@@ -2327,7 +2327,7 @@
23282328 * @return String: The doctype, opening <html>, and head element.
23292329 */
23302330 public function headElement( Skin $sk, $includeStyle = true ) {
2331 - global $wgContLang, $wgUseTrackbacks;
 2331+ global $wgContLang;
23322332 $userdir = $this->getLanguage()->getDir();
23332333 $sitedir = $wgContLang->getDir();
23342334
@@ -2356,10 +2356,6 @@
23572357 $this->getHeadItems()
23582358 ) );
23592359
2360 - if ( $wgUseTrackbacks && $this->isArticleRelated() ) {
2361 - $ret .= $this->getTitle()->trackbackRDF();
2362 - }
2363 -
23642360 $closeHead = Html::closeElement( 'head' );
23652361 if ( $closeHead ) {
23662362 $ret .= "$closeHead\n";
Index: trunk/phase3/includes/WikiPage.php
@@ -1651,7 +1651,7 @@
16521652 public function doDeleteArticle(
16531653 $reason, $suppress = false, $id = 0, $commit = true, &$error = '', User $user = null
16541654 ) {
1655 - global $wgUseTrackbacks, $wgUser;
 1655+ global $wgUser;
16561656 $user = is_null( $user ) ? $wgUser : $user;
16571657
16581658 wfDebug( __METHOD__ . "\n" );
@@ -1744,10 +1744,6 @@
17451745 if ( !$dbw->cascadingDeletes() ) {
17461746 $dbw->delete( 'revision', array( 'rev_page' => $id ), __METHOD__ );
17471747
1748 - if ( $wgUseTrackbacks ) {
1749 - $dbw->delete( 'trackbacks', array( 'tb_page' => $id ), __METHOD__ );
1750 - }
1751 -
17521748 # Delete outgoing links
17531749 $dbw->delete( 'pagelinks', array( 'pl_from' => $id ), __METHOD__ );
17541750 $dbw->delete( 'imagelinks', array( 'il_from' => $id ), __METHOD__ );
Index: trunk/phase3/maintenance/oracle/archives/patch_fk_rename_deferred.sql
@@ -35,7 +35,6 @@
3636 ALTER TABLE &mw_prefix.recentchanges ADD CONSTRAINT &mw_prefix.recentchanges_fk2 FOREIGN KEY (rc_cur_id) REFERENCES &mw_prefix.page(page_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
3737 ALTER TABLE &mw_prefix.watchlist ADD CONSTRAINT &mw_prefix.watchlist_fk1 FOREIGN KEY (wl_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
3838 ALTER TABLE &mw_prefix.logging ADD CONSTRAINT &mw_prefix.logging_fk1 FOREIGN KEY (log_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
39 -ALTER TABLE &mw_prefix.trackbacks ADD CONSTRAINT &mw_prefix.trackbacks_fk1 FOREIGN KEY (tb_page) REFERENCES &mw_prefix.page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
4039 ALTER TABLE &mw_prefix.redirect ADD CONSTRAINT &mw_prefix.redirect_fk1 FOREIGN KEY (rd_from) REFERENCES &mw_prefix.page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
4140 ALTER TABLE &mw_prefix.page_restrictions ADD CONSTRAINT &mw_prefix.page_restrictions_fk1 FOREIGN KEY (pr_page) REFERENCES &mw_prefix.page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
4241
Index: trunk/phase3/maintenance/oracle/tables.sql
@@ -511,18 +511,6 @@
512512 ALTER TABLE &mw_prefix.log_search ADD CONSTRAINT log_search_pk PRIMARY KEY (ls_field,ls_value,ls_log_id);
513513 CREATE INDEX &mw_prefix.log_search_i01 ON &mw_prefix.log_search (ls_log_id);
514514
515 -CREATE SEQUENCE trackbacks_tb_id_seq;
516 -CREATE TABLE &mw_prefix.trackbacks (
517 - tb_id NUMBER NOT NULL,
518 - tb_page NUMBER,
519 - tb_title VARCHAR2(255) NOT NULL,
520 - tb_url VARCHAR2(255) NOT NULL,
521 - tb_ex CLOB,
522 - tb_name VARCHAR2(255)
523 -);
524 -ALTER TABLE &mw_prefix.trackbacks ADD CONSTRAINT &mw_prefix.trackbacks_pk PRIMARY KEY (tb_id);
525 -ALTER TABLE &mw_prefix.trackbacks ADD CONSTRAINT &mw_prefix.trackbacks_fk1 FOREIGN KEY (tb_page) REFERENCES &mw_prefix.page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
526 -CREATE INDEX &mw_prefix.trackbacks_i01 ON &mw_prefix.trackbacks (tb_page);
527515
528516 CREATE SEQUENCE job_job_id_seq;
529517 CREATE TABLE &mw_prefix.job (
Index: trunk/phase3/maintenance/tables.sql
@@ -1247,17 +1247,6 @@
12481248 CREATE INDEX /*i*/ls_log_id ON /*_*/log_search (ls_log_id);
12491249
12501250
1251 -CREATE TABLE /*_*/trackbacks (
1252 - tb_id int PRIMARY KEY AUTO_INCREMENT,
1253 - tb_page int REFERENCES /*_*/page(page_id) ON DELETE CASCADE,
1254 - tb_title varchar(255) NOT NULL,
1255 - tb_url blob NOT NULL,
1256 - tb_ex text,
1257 - tb_name varchar(255)
1258 -) /*$wgDBTableOptions*/;
1259 -CREATE INDEX /*i*/tb_page ON /*_*/trackbacks (tb_page);
1260 -
1261 -
12621251 -- Jobs performed by parallel apache threads or a command-line daemon
12631252 CREATE TABLE /*_*/job (
12641253 job_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
Index: trunk/phase3/maintenance/mssql/tables.sql
@@ -642,16 +642,6 @@
643643 CREATE INDEX /*$wgDBprefix*/ls_log_id ON /*$wgDBprefix*/log_search (ls_log_id);
644644
645645
646 -CREATE TABLE /*$wgDBprefix*/trackbacks (
647 - tb_id INT PRIMARY KEY,
648 - tb_page INT REFERENCES /*$wgDBprefix*/page(page_id) ON DELETE CASCADE,
649 - tb_title NVARCHAR(255) NOT NULL,
650 - tb_url NVARCHAR(255) NOT NULL,
651 - tb_ex NVARCHAR(MAX),
652 - tb_name NVARCHAR(255),
653 -);
654 -CREATE INDEX /*$wgDBprefix*/trackbacks_page ON /*$wgDBprefix*/trackbacks(tb_page);
655 -
656646 -- Jobs performed by parallel apache threads or a command-line daemon
657647 CREATE TABLE /*$wgDBprefix*/job (
658648 job_id INT NOT NULL PRIMARY KEY,
Index: trunk/phase3/maintenance/postgres/tables.sql
@@ -16,7 +16,6 @@
1717 DROP SEQUENCE IF EXISTS ipblocks_ipb_id_seq CASCADE;
1818 DROP SEQUENCE IF EXISTS recentchanges_rc_id_seq CASCADE;
1919 DROP SEQUENCE IF EXISTS logging_log_id_seq CASCADE;
20 -DROP SEQUENCE IF EXISTS trackbacks_tb_id_seq CASCADE;
2120 DROP SEQUENCE IF EXISTS job_job_id_seq CASCADE;
2221 DROP SEQUENCE IF EXISTS category_cat_id_seq CASCADE;
2322 DROP FUNCTION IF EXISTS page_deleted() CASCADE;
@@ -512,18 +511,7 @@
513512 );
514513 CREATE INDEX ls_log_id ON log_search (ls_log_id);
515514
516 -CREATE SEQUENCE trackbacks_tb_id_seq;
517 -CREATE TABLE trackbacks (
518 - tb_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('trackbacks_tb_id_seq'),
519 - tb_page INTEGER REFERENCES page(page_id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
520 - tb_title TEXT NOT NULL,
521 - tb_url TEXT NOT NULL,
522 - tb_ex TEXT,
523 - tb_name TEXT
524 -);
525 -CREATE INDEX trackback_page ON trackbacks (tb_page);
526515
527 -
528516 CREATE SEQUENCE job_job_id_seq;
529517 CREATE TABLE job (
530518 job_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('job_job_id_seq'),
Index: trunk/phase3/maintenance/postgres/mediawiki_mysql2postgres.pl
@@ -417,7 +417,6 @@
418418 SELECT setval('recentchanges_rc_id_seq', 1+coalesce(max(rc_id) ,0),false) FROM recentchanges;
419419 SELECT setval('revision_rev_id_seq', 1+coalesce(max(rev_id) ,0),false) FROM revision;
420420 SELECT setval('text_old_id_seq', 1+coalesce(max(old_id) ,0),false) FROM pagecontent;
421 -SELECT setval('trackbacks_tb_id_seq', 1+coalesce(max(tb_id) ,0),false) FROM trackbacks;
422421 SELECT setval('user_user_id_seq', 1+coalesce(max(user_id),0),false) FROM mwuser;
423422 };
424423
@@ -437,7 +436,6 @@
438437 objectcache
439438
440439 ## Which tables to ignore depending on the version
441 -VERSION 1.5: trackback
442440 VERSION 1.6: externallinks job templatelinks transcache
443441 VERSION 1.7: filearchive langlinks querycache_info
444442 VERSION 1.9: querycachetwo page_restrictions redirect
Index: trunk/phase3/maintenance/language/messages.inc
@@ -1140,7 +1140,6 @@
11411141 'right-autopatrol',
11421142 'right-patrolmarks',
11431143 'right-unwatchedpages',
1144 - 'right-trackback',
11451144 'right-mergehistory',
11461145 'right-userrights',
11471146 'right-userrights-interwiki',
@@ -1187,7 +1186,6 @@
11881187 'action-patrol',
11891188 'action-autopatrol',
11901189 'action-unwatchedpages',
1191 - 'action-trackback',
11921190 'action-mergehistory',
11931191 'action-userrights',
11941192 'action-userrights-interwiki',
@@ -3180,14 +3178,6 @@
31813179 'scarytranscludefailed',
31823180 'scarytranscludetoolong',
31833181 ),
3184 - 'trackbacks' => array(
3185 - 'trackbackbox',
3186 - 'trackback',
3187 - 'trackbackexcerpt',
3188 - 'trackbackremove',
3189 - 'trackbacklink',
3190 - 'trackbackdeleteok',
3191 - ),
31923182 'deleteconflict' => array(
31933183 'deletedwhileediting',
31943184 'confirmrecreate',
@@ -3706,7 +3696,6 @@
37073697 'all' => "'all' in various places, this might be different for inflected languages",
37083698 'confirmemail' => 'E-mail address confirmation',
37093699 'scarytransclusion' => 'Scary transclusion',
3710 - 'trackbacks' => 'Trackbacks',
37113700 'deleteconflict' => 'Delete conflict',
37123701 'unit-pixel' => '',
37133702 'purge' => 'action=purge',
Index: trunk/phase3/maintenance/language/messageTypes.inc
@@ -393,8 +393,6 @@
394394 'diff-with-additional',
395395 'pagetitle-view-mainpage',
396396 'backlinksubtitle',
397 - 'trackback',
398 - 'trackbackexcerpt',
399397 'prefs-registration-date-time',
400398 'prefs-memberingroups-type',
401399 'shared-repo-name-wikimediacommons',
Index: trunk/phase3/maintenance/ibm_db2/tables.sql
@@ -523,22 +523,6 @@
524524 CREATE INDEX log_page_id_time ON logging (log_page,log_timestamp);
525525
526526
527 -
528 -CREATE TABLE trackbacks (
529 - tb_id INTEGER NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
530 - --PRIMARY KEY DEFAULT nextval('trackbacks_tb_id_seq'),
531 - -- foreign key also in MySQL
532 - tb_page INTEGER,
533 - -- REFERENCES page(page_id) ON DELETE CASCADE,
534 - tb_title VARCHAR(255) NOT NULL,
535 - tb_url CLOB(64K) INLINE LENGTH 4096 NOT NULL,
536 - tb_ex CLOB(64K) INLINE LENGTH 4096,
537 - tb_name VARCHAR(255)
538 -);
539 -CREATE INDEX trackback_page ON trackbacks (tb_page);
540 -
541 -
542 -
543527 CREATE TABLE job (
544528 job_id BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (START WITH 1),
545529 --PRIMARY KEY DEFAULT nextval('job_job_id_seq'),
Index: trunk/phase3/maintenance/ibm_db2/foreignkeys.sql
@@ -93,11 +93,6 @@
9494 ALTER TABLE watchlist ADD CONSTRAINT WATCHLIST_USER_FK FOREIGN KEY (wl_user) REFERENCES user(user_id) ON DELETE CASCADE
9595 ;
9696
97 -ALTER TABLE trackbacks ADD CONSTRAINT TRACKBACKS_PAGE_FK FOREIGN KEY (tb_page) REFERENCES page(page_id) ON DELETE CASCADE
98 -;
99 -
10097 -- cannot contain null values
10198 -- ALTER TABLE protected_titles ADD CONSTRAINT PROTECTED_TITLES_USER_FK FOREIGN KEY (pt_user) REFERENCES user(user_id) ON DELETE SET NULL
10299 --;
Index: trunk/phase3/maintenance/sqlite/archives/initial-indexes.sql
@@ -406,7 +406,6 @@
407407 CREATE INDEX /*i*/user_time ON /*_*/logging (log_user, log_timestamp);
408408 CREATE INDEX /*i*/page_time ON /*_*/logging (log_namespace, log_title, log_timestamp);
409409 CREATE INDEX /*i*/times ON /*_*/logging (log_timestamp);
410 -CREATE INDEX /*i*/tb_page ON /*_*/trackbacks (tb_page);
411410 CREATE INDEX /*i*/job_cmd_namespace_title ON /*_*/job (job_cmd, job_namespace, job_title);
412411 CREATE INDEX /*i*/rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from);
413412 CREATE INDEX /*i*/qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value);
Index: trunk/phase3/maintenance/fuzz-tester.php
@@ -108,7 +108,6 @@
109109 $wgGroupPermissions['*']['reupload-shared'] = true;
110110 $wgGroupPermissions['*']['rollback'] = true;
111111 $wgGroupPermissions['*']['siteadmin'] = true;
112 - $wgGroupPermissions['*']['trackback'] = true;
113112 $wgGroupPermissions['*']['unwatchedpages'] = true;
114113 $wgGroupPermissions['*']['upload'] = true;
115114 $wgGroupPermissions['*']['userrights'] = true;
@@ -121,7 +120,6 @@
122121 error_reporting (E_ALL); // At a later date could be increased to E_ALL | E_STRICT
123122 $wgBlockOpenProxies = true; // Some block pages require this to be true in order to test.
124123 $wgEnableUploads = true; // enable uploads.
125 - //$wgUseTrackbacks = true; // enable trackbacks; However this breaks the viewPageTest, so currently disabled.
126124 $wgDBerrorLog = "/root/mediawiki-db-error-log.txt"; // log DB errors, replace with suitable path.
127125 $wgShowSQLErrors = true; // Show SQL errors (instead of saying the query was hidden).
128126 $wgShowExceptionDetails = true; // want backtraces.
@@ -1819,33 +1817,7 @@
18201818 }
18211819 }
18221820
1823 -
18241821 /**
1825 - ** a test for trackback.php
1826 - */
1827 -class trackbackTest extends pageTest {
1828 - function __construct() {
1829 - $this->pagePath = "trackback.php";
1830 -
1831 - $this->params = array (
1832 - "url" => wikiFuzz::makeFuzz( 2 ),
1833 - "blog_name" => wikiFuzz::chooseInput( array( "80", wikiFuzz::randnum( 6000, -200 ), wikiFuzz::makeFuzz( 2 ) ) ),
1834 - "article" => wikiFuzz::chooseInput( array( "Main Page", wikiFuzz::makeFuzz( 2 ) ) ),
1835 - "title" => wikiFuzz::chooseInput( array( "Main Page", wikiFuzz::makeFuzz( 2 ) ) ),
1836 - "excerpt" => wikiFuzz::makeFuzz( 2 ),
1837 - );
1838 -
1839 - // sometimes we don't want to specify certain parameters.
1840 - if ( wikiFuzz::randnum( 3 ) == 0 ) unset( $this->params["title"] );
1841 - if ( wikiFuzz::randnum( 3 ) == 0 ) unset( $this->params["excerpt"] );
1842 -
1843 - // page does not produce HTML.
1844 - $this->tidyValidate = false;
1845 - }
1846 -}
1847 -
1848 -
1849 -/**
18501822 ** a test for profileinfo.php
18511823 */
18521824 class profileInfo extends pageTest {
@@ -2188,7 +2160,7 @@
21892161 /**
21902162 ** selects a page test to run.
21912163 * @param $count
2192 - * @return \api|\confirmEmail|\contributionsTest|\editPageTest|\imagelistTest|\imagepageTest|\ipblocklistTest|\listusersTest|\mimeSearchTest|\newImagesTest|\pageDeletion|\pageHistoryTest|\pageProtectionForm|\prefixindexTest|\profileInfo|\recentchangesTest|\redirectTest|\searchTest|\specialAllmessagesTest|\specialAllpagesTest|\specialBlockip|\specialBlockmeTest|\specialBooksourcesTest|\specialCategoryTree|\specialChemicalsourcesTest|\specialCitePageTest|\specialExportTest|\specialFilepathPageTest|\specialImportPageTest|\specialLinksearch|\specialLockdbPageTest|\specialLogTest|\specialMovePage|\specialNewpagesPageTest|\specialRenameuserPageTest|\specialRevisionDeletePageTest|\specialUndeletePageTest|\specialUnlockdbPageTest|\specialUserrights|\successfulUserLoginTest|\thumbTest|\trackbackTest|\userLoginTest|\viewPageTest|\watchlistTest
 2164+ * @return \api|\confirmEmail|\contributionsTest|\editPageTest|\imagelistTest|\imagepageTest|\ipblocklistTest|\listusersTest|\mimeSearchTest|\newImagesTest|\pageDeletion|\pageHistoryTest|\pageProtectionForm|\prefixindexTest|\profileInfo|\recentchangesTest|\redirectTest|\searchTest|\specialAllmessagesTest|\specialAllpagesTest|\specialBlockip|\specialBlockmeTest|\specialBooksourcesTest|\specialCategoryTree|\specialChemicalsourcesTest|\specialCitePageTest|\specialExportTest|\specialFilepathPageTest|\specialImportPageTest|\specialLinksearch|\specialLockdbPageTest|\specialLogTest|\specialMovePage|\specialNewpagesPageTest|\specialRenameuserPageTest|\specialRevisionDeletePageTest|\specialUndeletePageTest|\specialUnlockdbPageTest|\specialUserrights|\successfulUserLoginTest|\thumbTest|\userLoginTest|\viewPageTest|\watchlistTest
21932165 */
21942166 function selectPageTest( $count ) {
21952167
@@ -2237,7 +2209,6 @@
22382210 case 33: return new specialRevisionDeletePageTest();
22392211 case 34: return new specialImportPageTest();
22402212 case 35: return new thumbTest();
2241 - case 36: return new trackbackTest();
22422213 case 37: return new profileInfo();
22432214 case 38: return new specialCitePageTest();
22442215 case 39: return new specialFilepathPageTest();
Index: trunk/phase3/maintenance/archives/patch-trackbacks.sql
@@ -1,10 +0,0 @@
2 -CREATE TABLE /*$wgDBprefix*/trackbacks (
3 - tb_id INTEGER AUTO_INCREMENT PRIMARY KEY,
4 - tb_page INTEGER REFERENCES page(page_id) ON DELETE CASCADE,
5 - tb_title VARCHAR(255) NOT NULL,
6 - tb_url BLOB NOT NULL,
7 - tb_ex TEXT,
8 - tb_name VARCHAR(255),
9 -
10 - INDEX (tb_page)
11 -);

Sign-offs

UserFlagDate
Nikerabbitinspected08:04, 24 November 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r104053Follow-up r104051: fix testsmaxsem17:27, 23 November 2011
r104063Follow-up r104051: Rebuild message files.siebrand18:46, 23 November 2011

Comments

#Comment by Nikerabbit (talk | contribs)   08:05, 24 November 2011

What's the practice of deleting tables? Do users need to delete the table manually or do we do it automatically on upgrade?

#Comment by 😂 (talk | contribs)   15:16, 28 November 2011

It shouldn't matter at all, it's just an extra table that's probably empty anyway. No point in adding an updater for it.

#Comment by MaxSem (talk | contribs)   15:17, 28 November 2011

The table should be retained in case there's someone who really uses this feature and they may want to use the trackbacks data in the future (e.g. by writing an extension). Trackbacks are nothing but a source of spam these days though.

#Comment by 😂 (talk | contribs)   15:18, 28 November 2011

I was going to say that, but then I started laughing at the notion that someone actually uses this.

#Comment by Brettz9 (talk | contribs)   06:22, 27 December 2011

I would use it and would like to see it expanded (https://bugzilla.wikimedia.org/show_bug.cgi?id=33373 ), though admittedly it is a useless battle on a completely open wiki. But I work with affiliates who maintain their own related wikis, and being able to interlink would be very powerful. But I think it seems I'll have to make it as an extension.

#Comment by Hashar (talk | contribs)   11:56, 5 December 2011

Tagging as historical. The feature was added by River a long time ago when blogs used trackback a lot :-D

Status & tagging log