r109165 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109164‎ | r109165 | r109166 >
Date:17:28, 17 January 2012
Author:yaron
Status:resolved (Comments)
Tags:
Comment:
Added compatibility for SMW 1.6 (finally), moved all functions into class, plus some stylistic improvements
Modified paths:
  • /trunk/extensions/DataTransfer/specials/DT_ViewXML.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DataTransfer/specials/DT_ViewXML.php
@@ -5,8 +5,6 @@
66 * @author Yaron Koren
77 */
88
9 -if ( !defined( 'MEDIAWIKI' ) ) die();
10 -
119 class DTViewXML extends SpecialPage {
1210
1311 /**
@@ -18,103 +16,110 @@
1917
2018 function execute( $query ) {
2119 $this->setHeaders();
22 - doSpecialViewXML( $query );
 20+ self::doSpecialViewXML( $query );
2321 }
24 -}
2522
26 -function getCategoriesList() {
27 - global $wgContLang, $dtgContLang;
28 - $dt_props = $dtgContLang->getPropertyLabels();
29 - $exclusion_cat_name = str_replace( ' ', '_', $dt_props[DT_SP_IS_EXCLUDED_FROM_XML] );
30 - $exclusion_cat_full_name = $wgContLang->getNSText( NS_CATEGORY ) . ':' . $exclusion_cat_name;
31 - $dbr = wfGetDB( DB_SLAVE );
32 - $categorylinks = $dbr->tableName( 'categorylinks' );
33 - $res = $dbr->query( "SELECT DISTINCT cl_to FROM $categorylinks" );
34 - $categories = array();
35 - while ( $row = $dbr->fetchRow( $res ) ) {
36 - $cat_name = $row[0];
37 - // add this category to the list, if it's not the
38 - // "Excluded from XML" category, and it's not a child of that
39 - // category
40 - if ( $cat_name != $exclusion_cat_name ) {
41 - $title = Title::newFromText( $cat_name, NS_CATEGORY );
42 - $parent_categories = $title->getParentCategoryTree( array() );
43 - if ( ! treeContainsElement( $parent_categories, $exclusion_cat_full_name ) )
44 - $categories[] = $cat_name;
 23+ static function getCategoriesList() {
 24+ global $wgContLang, $dtgContLang;
 25+ $dt_props = $dtgContLang->getPropertyLabels();
 26+ $exclusion_cat_name = str_replace( ' ', '_', $dt_props[DT_SP_IS_EXCLUDED_FROM_XML] );
 27+ $exclusion_cat_full_name = $wgContLang->getNSText( NS_CATEGORY ) . ':' . $exclusion_cat_name;
 28+ $dbr = wfGetDB( DB_SLAVE );
 29+ $categorylinks = $dbr->tableName( 'categorylinks' );
 30+ $res = $dbr->query( "SELECT DISTINCT cl_to FROM $categorylinks" );
 31+ $categories = array();
 32+ while ( $row = $dbr->fetchRow( $res ) ) {
 33+ $cat_name = $row[0];
 34+ // Add this category to the list, if it's not the
 35+ // "Excluded from XML" category, and it's not a child
 36+ // of that category.
 37+ if ( $cat_name != $exclusion_cat_name ) {
 38+ $title = Title::newFromText( $cat_name, NS_CATEGORY );
 39+ $parent_categories = $title->getParentCategoryTree( array() );
 40+ if ( ! self::treeContainsElement( $parent_categories, $exclusion_cat_full_name ) )
 41+ $categories[] = $cat_name;
 42+ }
4543 }
 44+ $dbr->freeResult( $res );
 45+ sort( $categories );
 46+ return $categories;
4647 }
47 - $dbr->freeResult( $res );
48 - sort( $categories );
49 - return $categories;
50 -}
5148
52 -function getNamespacesList() {
53 - $dbr = wfGetDB( DB_SLAVE );
54 - $page = $dbr->tableName( 'page' );
55 - $res = $dbr->query( "SELECT DISTINCT page_namespace FROM $page" );
56 - $namespaces = array();
57 - while ( $row = $dbr->fetchRow( $res ) ) {
58 - $namespaces[] = $row[0];
 49+ function getNamespacesList() {
 50+ $dbr = wfGetDB( DB_SLAVE );
 51+ $page = $dbr->tableName( 'page' );
 52+ $res = $dbr->query( "SELECT DISTINCT page_namespace FROM $page" );
 53+ $namespaces = array();
 54+ while ( $row = $dbr->fetchRow( $res ) ) {
 55+ $namespaces[] = $row[0];
 56+ }
 57+ $dbr->freeResult( $res );
 58+ return $namespaces;
5959 }
60 - $dbr->freeResult( $res );
61 - return $namespaces;
62 -}
6360
64 -function getGroupings() {
65 - global $dtgContLang;
 61+ function getGroupings() {
 62+ global $dtgContLang, $smwgIP;
6663
67 - global $smwgIP;
68 - if ( ! isset( $smwgIP ) ) {
69 - return array();
70 - } else {
71 - $groupings = array();
72 - $store = smwfGetStore();
73 - $grouping_prop = SMWPropertyValue::makeProperty( '_DT_XG' );
74 - $grouped_props = $store->getAllPropertySubjects( $grouping_prop );
75 - foreach ( $grouped_props as $grouped_prop ) {
76 - $res = $store->getPropertyValues( $grouped_prop, $grouping_prop );
77 - $num = count( $res );
78 - if ( $num > 0 ) {
79 - $grouping_label = $res[0]->getShortWikiText();
80 - $groupings[] = array( $grouped_prop, $grouping_label );
81 - }
82 - }
83 - return $groupings;
84 - }
85 -}
86 -
87 -function getSubpagesForPageGrouping( $page_name, $relation_name ) {
88 - $dbr = wfGetDB( DB_SLAVE );
89 - $smw_relations = $dbr->tableName( 'smw_relations' );
90 - $smw_attributes = $dbr->tableName( 'smw_attributes' );
91 - $res = $dbr->query( "SELECT subject_title FROM $smw_relations WHERE object_title = '$page_name' AND relation_title = '$relation_name'" );
92 - $subpages = array();
93 - while ( $row = $dbr->fetchRow( $res ) ) {
94 - $subpage_name = $row[0];
95 - $query_subpage_name = str_replace( "'", "\'", $subpage_name );
96 - // get the display order
97 - $res2 = $dbr->query( "SELECT value_num FROM $smw_attributes WHERE subject_title = '$query_subpage_name' AND attribute_title = 'Display_order'" );
98 - if ( $row2 = $dbr->fetchRow( $res2 ) ) {
99 - $display_order = $row2[0];
 64+ if ( ! isset( $smwgIP ) ) {
 65+ return array();
10066 } else {
101 - $display_order = - 1;
 67+ $groupings = array();
 68+ $store = smwfGetStore();
 69+ // SMWDIProperty was added in SMW 1.6
 70+ if ( class_exists( 'SMWDIProperty' ) ) {
 71+ $grouping_prop = SMWDIProperty::newFromUserLabel( '_DT_XG' );
 72+ } else {
 73+ $grouping_prop = SMWPropertyValue::makeProperty( '_DT_XG' );
 74+ }
 75+ $grouped_props = $store->getAllPropertySubjects( $grouping_prop );
 76+ foreach ( $grouped_props as $grouped_prop ) {
 77+ $res = $store->getPropertyValues( $grouped_prop, $grouping_prop );
 78+ $num = count( $res );
 79+ if ( $num > 0 ) {
 80+ if ( class_exists( 'SMWDIProperty' ) ) {
 81+ $grouping_label = $res[0]->getSortKey();
 82+ } else {
 83+ $grouping_label = $res[0]->getShortWikiText();
 84+ }
 85+ $groupings[] = array( $grouped_prop, $grouping_label );
 86+ }
 87+ }
 88+ return $groupings;
10289 }
103 - $dbr->freeResult( $res2 );
104 - // HACK - page name is the key, display order is the value
105 - $subpages[$subpage_name] = $display_order;
10690 }
107 - $dbr->freeResult( $res );
108 - uasort( $subpages, "cmp" );
109 - return array_keys( $subpages );
110 -}
11191
 92+ static function getSubpagesForPageGrouping( $page_name, $relation_name ) {
 93+ $dbr = wfGetDB( DB_SLAVE );
 94+ $smw_relations = $dbr->tableName( 'smw_relations' );
 95+ $smw_attributes = $dbr->tableName( 'smw_attributes' );
 96+ $res = $dbr->query( "SELECT subject_title FROM $smw_relations WHERE object_title = '$page_name' AND relation_title = '$relation_name'" );
 97+ $subpages = array();
 98+ while ( $row = $dbr->fetchRow( $res ) ) {
 99+ $subpage_name = $row[0];
 100+ $query_subpage_name = str_replace( "'", "\'", $subpage_name );
 101+ // get the display order
 102+ $res2 = $dbr->query( "SELECT value_num FROM $smw_attributes WHERE subject_title = '$query_subpage_name' AND attribute_title = 'Display_order'" );
 103+ if ( $row2 = $dbr->fetchRow( $res2 ) ) {
 104+ $display_order = $row2[0];
 105+ } else {
 106+ $display_order = - 1;
 107+ }
 108+ $dbr->freeResult( $res2 );
 109+ // HACK - page name is the key, display order is the value
 110+ $subpages[$subpage_name] = $display_order;
 111+ }
 112+ $dbr->freeResult( $res );
 113+ uasort( $subpages, "cmp" );
 114+ return array_keys( $subpages );
 115+ }
112116
113 -/**
 117+
 118+/*
114119 * Get all the pages that belong to a category and all its subcategories,
115120 * down a certain number of levels - heavily based on SMW's
116121 * SMWInlineQuery::includeSubcategories()
117122 */
118 - function getPagesForCategory( $top_category, $num_levels ) {
 123+ static function getPagesForCategory( $top_category, $num_levels ) {
119124 if ( 0 == $num_levels ) return $top_category;
120125
121126 $db = wfGetDB( DB_SLAVE );
@@ -159,7 +164,7 @@
160165 }
161166
162167 /*
163 -function getPagesForCategory($category) {
 168+static function getPagesForCategory($category) {
164169 $dbr = wfGetDB( DB_SLAVE );
165170 $categorylinks = $dbr->tableName( 'categorylinks' );
166171 $res = $dbr->query("SELECT cl_from FROM $categorylinks WHERE cl_to = '$category'");
@@ -172,7 +177,7 @@
173178 }
174179 */
175180
176 -function getPagesForNamespace( $namespace ) {
 181+static function getPagesForNamespace( $namespace ) {
177182 $dbr = wfGetDB( DB_SLAVE );
178183 $page = $dbr->tableName( 'page' );
179184 $res = $dbr->query( "SELECT page_id FROM $page WHERE page_namespace = '$namespace'" );
@@ -184,28 +189,28 @@
185190 return $titles;
186191 }
187192
188 -/**
189 - * Helper function for getXMLForPage()
190 - */
191 -function treeContainsElement( $tree, $element ) {
192 - // escape out if there's no tree (i.e., category)
193 - if ( $tree == null )
194 - return false;
 193+ /**
 194+ * Helper function for getXMLForPage()
 195+ */
 196+ static function treeContainsElement( $tree, $element ) {
 197+ // escape out if there's no tree (i.e., category)
 198+ if ( $tree == null )
 199+ return false;
195200
196 - foreach ( $tree as $node => $child_tree ) {
197 - if ( $node === $element ) {
198 - return true;
199 - } elseif ( count( $child_tree ) > 0 ) {
200 - if ( treeContainsElement( $child_tree, $element ) ) {
 201+ foreach ( $tree as $node => $child_tree ) {
 202+ if ( $node === $element ) {
201203 return true;
 204+ } elseif ( count( $child_tree ) > 0 ) {
 205+ if ( self::treeContainsElement( $child_tree, $element ) ) {
 206+ return true;
 207+ }
202208 }
203209 }
 210+ // no match found
 211+ return false;
204212 }
205 - // no match found
206 - return false;
207 -}
208213
209 -function getXMLForPage( $title, $simplified_format, $groupings, $depth = 0 ) {
 214+static function getXMLForPage( $title, $simplified_format, $groupings, $depth = 0 ) {
210215 if ( $depth > 5 ) { return ""; }
211216
212217 global $wgContLang, $dtgContLang;
@@ -225,11 +230,12 @@
226231 $dt_props = $dtgContLang->getPropertyLabels();
227232 // $exclusion_category = $title->newFromText($dt_props[DT_SP_IS_EXCLUDED_FROM_XML], NS_CATEGORY);
228233 $exclusion_category = $wgContLang->getNSText( NS_CATEGORY ) . ':' . str_replace( ' ', '_', $dt_props[DT_SP_IS_EXCLUDED_FROM_XML] );
229 - if ( treeContainsElement( $parent_categories, $exclusion_category ) )
 234+ if ( self::treeContainsElement( $parent_categories, $exclusion_category ) )
230235 return "";
231236 $article = new Article( $title );
232237 $page_title = str_replace( '"', '"', $title->getText() );
233238 $page_title = str_replace( '&', '&', $page_title );
 239+ $page_namespace = $title->getNamespace();
234240 if ( $simplified_format )
235241 $text = "<$page_str><$id_str>{$article->getID()}</$id_str><$title_str>$page_title</$title_str>\n";
236242 else
@@ -376,11 +382,16 @@
377383 $store = smwfGetStore();
378384 foreach ( $groupings as $pair ) {
379385 list( $property_page, $grouping_label ) = $pair;
380 - $wiki_page = SMWDataValueFactory::newTypeIDValue( '_wpg', $page_title );
381386 $options = new SMWRequestOptions();
382387 $options->sort = "subject_title";
383388 // get actual property from the wiki-page of the property
384 - $property = SMWPropertyValue::makeProperty( $property_page->getTitle()->getText() );
 389+ if ( class_exists( 'SMWDIProperty' ) ) {
 390+ $wiki_page = new SMWDIWikiPage( $page_title, $page_namespace, null );
 391+ $property = SMWDIProperty::newFromUserLabel( $property_page->getTitle()->getText() );
 392+ } else {
 393+ $wiki_page = SMWDataValueFactory::newTypeIDValue( '_wpg', $page_title );
 394+ $property = SMWPropertyValue::makeProperty( $property_page->getTitle()->getText() );
 395+ }
385396 $res = $store->getPropertySubjects( $property, $wiki_page, $options );
386397 $num = count( $res );
387398 if ( $num > 0 ) {
@@ -388,7 +399,7 @@
389400 $text .= "<$grouping_label>\n";
390401 foreach ( $res as $subject ) {
391402 $subject_title = $subject->getTitle();
392 - $text .= getXMLForPage( $subject_title, $simplified_format, $groupings, $depth + 1 );
 403+ $text .= self::getXMLForPage( $subject_title, $simplified_format, $groupings, $depth + 1 );
393404 }
394405 $text .= "</$grouping_label>\n";
395406 }
@@ -402,108 +413,113 @@
403414 return $text;
404415 }
405416
406 -function doSpecialViewXML() {
407 - global $wgOut, $wgRequest, $wgUser, $wgContLang;
408 - $skin = $wgUser->getSkin();
409 - $namespace_labels = $wgContLang->getNamespaces();
410 - $category_label = $namespace_labels[NS_CATEGORY];
411 - $template_label = $namespace_labels[NS_TEMPLATE];
412 - $name_str = str_replace( ' ', '_', wfMsgForContent( 'dt_xml_name' ) );
413 - $namespace_str = str_replace( ' ', '_', wfMsg( 'dt_xml_namespace' ) );
414 - $pages_str = str_replace( ' ', '_', wfMsgForContent( 'dt_xml_pages' ) );
 417+ static function doSpecialViewXML() {
 418+ global $wgOut, $wgRequest, $wgUser, $wgContLang;
415419
416 - $form_submitted = false;
417 - $page_titles = array();
418 - $cats = $wgRequest->getArray( 'categories' );
419 - $nses = $wgRequest->getArray( 'namespaces' );
420 - if ( count( $cats ) > 0 || count( $nses ) > 0 ) {
421 - $form_submitted = true;
422 - }
 420+ $skin = $wgUser->getSkin();
 421+ $namespace_labels = $wgContLang->getNamespaces();
 422+ $category_label = $namespace_labels[NS_CATEGORY];
 423+ $template_label = $namespace_labels[NS_TEMPLATE];
 424+ $name_str = str_replace( ' ', '_', wfMsgForContent( 'dt_xml_name' ) );
 425+ $namespace_str = str_replace( ' ', '_', wfMsg( 'dt_xml_namespace' ) );
 426+ $pages_str = str_replace( ' ', '_', wfMsgForContent( 'dt_xml_pages' ) );
423427
424 - if ( $form_submitted ) {
425 - $wgOut->disable();
 428+ $form_submitted = false;
 429+ $page_titles = array();
 430+ $cats = $wgRequest->getArray( 'categories' );
 431+ $nses = $wgRequest->getArray( 'namespaces' );
 432+ if ( count( $cats ) > 0 || count( $nses ) > 0 ) {
 433+ $form_submitted = true;
 434+ }
426435
427 - // Cancel output buffering and gzipping if set
428 - // This should provide safer streaming for pages with history
429 - wfResetOutputBuffers();
430 - header( "Content-type: application/xml; charset=utf-8" );
 436+ if ( $form_submitted ) {
 437+ $wgOut->disable();
431438
432 - $groupings = getGroupings();
433 - $simplified_format = $wgRequest->getVal( 'simplified_format' );
434 - $text = "<$pages_str>";
435 - if ( $cats ) {
436 - foreach ( $cats as $cat => $val ) {
437 - if ( $simplified_format )
438 - $text .= '<' . str_replace( ' ', '_', $cat ) . ">\n";
439 - else
440 - $text .= "<$category_label $name_str=\"$cat\">\n";
441 - $titles = getPagesForCategory( $cat, 10 );
442 - foreach ( $titles as $title ) {
443 - $text .= getXMLForPage( $title, $simplified_format, $groupings );
 439+ // Cancel output buffering and gzipping if set
 440+ // This should provide safer streaming for pages with history
 441+ wfResetOutputBuffers();
 442+ header( "Content-type: application/xml; charset=utf-8" );
 443+
 444+ $groupings = self::getGroupings();
 445+ $simplified_format = $wgRequest->getVal( 'simplified_format' );
 446+ $text = "<$pages_str>";
 447+ if ( $cats ) {
 448+ foreach ( $cats as $cat => $val ) {
 449+ if ( $simplified_format )
 450+ $text .= '<' . str_replace( ' ', '_', $cat ) . ">\n";
 451+ else
 452+ $text .= "<$category_label $name_str=\"$cat\">\n";
 453+ $titles = self::getPagesForCategory( $cat, 10 );
 454+ foreach ( $titles as $title ) {
 455+ $text .= self::getXMLForPage( $title, $simplified_format, $groupings );
 456+ }
 457+ if ( $simplified_format ) {
 458+ $text .= '</' . str_replace( ' ', '_', $cat ) . ">\n";
 459+ } else {
 460+ $text .= "</$category_label>\n";
 461+ }
444462 }
445 - if ( $simplified_format )
446 - $text .= '</' . str_replace( ' ', '_', $cat ) . ">\n";
447 - else
448 - $text .= "</$category_label>\n";
449463 }
450 - }
451464
452 - if ( $nses ) {
453 - foreach ( $nses as $ns => $val ) {
454 - if ( $ns == 0 ) {
455 - $ns_name = "Main";
456 - } else {
457 - $ns_name = MWNamespace::getCanonicalName( $ns );
 465+ if ( $nses ) {
 466+ foreach ( $nses as $ns => $val ) {
 467+ if ( $ns == 0 ) {
 468+ $ns_name = "Main";
 469+ } else {
 470+ $ns_name = MWNamespace::getCanonicalName( $ns );
 471+ }
 472+ if ( $simplified_format ) {
 473+ $text .= '<' . str_replace( ' ', '_', $ns_name ) . ">\n";
 474+ } else {
 475+ $text .= "<$namespace_str $name_str=\"$ns_name\">\n";
 476+ }
 477+ $titles = self::getPagesForNamespace( $ns );
 478+ foreach ( $titles as $title ) {
 479+ $text .= self::getXMLForPage( $title, $simplified_format, $groupings );
 480+ }
 481+ if ( $simplified_format )
 482+ $text .= '</' . str_replace( ' ', '_', $ns_name ) . ">\n";
 483+ else
 484+ $text .= "</$namespace_str>\n";
458485 }
459 - if ( $simplified_format )
460 - $text .= '<' . str_replace( ' ', '_', $ns_name ) . ">\n";
461 - else
462 - $text .= "<$namespace_str $name_str=\"$ns_name\">\n";
463 - $titles = getPagesForNamespace( $ns );
464 - foreach ( $titles as $title ) {
465 - $text .= getXMLForPage( $title, $simplified_format, $groupings );
466 - }
467 - if ( $simplified_format )
468 - $text .= '</' . str_replace( ' ', '_', $ns_name ) . ">\n";
469 - else
470 - $text .= "</$namespace_str>\n";
471486 }
472 - }
473 - $text .= "</$pages_str>";
474 - print $text;
475 - } else {
476 - // set 'title' as hidden field, in case there's no URL niceness
477 - global $wgContLang;
478 - $mw_namespace_labels = $wgContLang->getNamespaces();
479 - $special_namespace = $mw_namespace_labels[NS_SPECIAL];
480 - $text = <<<END
 487+ $text .= "</$pages_str>";
 488+ print $text;
 489+ } else {
 490+ // set 'title' as hidden field, in case there's no URL niceness
 491+ global $wgContLang;
 492+ $mw_namespace_labels = $wgContLang->getNamespaces();
 493+ $special_namespace = $mw_namespace_labels[NS_SPECIAL];
 494+ $text = <<<END
481495 <form action="" method="get">
482496 <input type="hidden" name="title" value="$special_namespace:ViewXML">
483497
484498 END;
485 - $text .= "<p>" . wfMsg( 'dt_viewxml_docu' ) . "</p>\n";
486 - $text .= "<h2>" . wfMsg( 'dt_viewxml_categories' ) . "</h2>\n";
487 - $categories = getCategoriesList();
488 - foreach ( $categories as $category ) {
489 - $title = Title::makeTitle( NS_CATEGORY, $category );
490 - $link = $skin->makeLinkObj( $title, htmlspecialchars( $title->getText() ) );
491 - $text .= "<input type=\"checkbox\" name=\"categories[$category]\" /> $link <br />\n";
492 - }
493 - $text .= "<h2>" . wfMsg( 'dt_viewxml_namespaces' ) . "</h2>\n";
494 - $namespaces = getNamespacesList();
495 - foreach ( $namespaces as $namespace ) {
496 - if ( $namespace == 0 ) {
497 - $ns_name = wfMsgHtml( 'blanknamespace' );
498 - } else {
499 - $ns_name = htmlspecialchars( $wgContLang->getFormattedNsText( $namespace ) );
 499+ $text .= "<p>" . wfMsg( 'dt_viewxml_docu' ) . "</p>\n";
 500+ $text .= "<h2>" . wfMsg( 'dt_viewxml_categories' ) . "</h2>\n";
 501+ $categories = getCategoriesList();
 502+ foreach ( $categories as $category ) {
 503+ $title = Title::makeTitle( NS_CATEGORY, $category );
 504+ $link = $skin->makeLinkObj( $title, $title->getText() );
 505+ $text .= "<input type=\"checkbox\" name=\"categories[$category]\" /> $link <br />\n";
500506 }
501 - $ns_name = str_replace( '_', ' ', $ns_name );
502 - $text .= "<input type=\"checkbox\" name=\"namespaces[$namespace]\" /> $ns_name <br />\n";
 507+ $text .= "<h2>" . wfMsg( 'dt_viewxml_namespaces' ) . "</h2>\n";
 508+ $namespaces = getNamespacesList();
 509+ foreach ( $namespaces as $namespace ) {
 510+ if ( $namespace == 0 ) {
 511+ $ns_name = wfMsgHtml( 'blanknamespace' );
 512+ } else {
 513+ $ns_name = htmlspecialchars( $wgContLang->getFormattedNsText( $namespace ) );
 514+ }
 515+ $ns_name = str_replace( '_', ' ', $ns_name );
 516+ $text .= "<input type=\"checkbox\" name=\"namespaces[$namespace]\" /> $ns_name <br />\n";
 517+ }
 518+ $text .= "<br /><p><input type=\"checkbox\" name=\"simplified_format\" /> " . wfMsg( 'dt_viewxml_simplifiedformat' ) . "</p>\n";
 519+ $text .= "<input type=\"submit\" value=\"" . wfMsg( 'viewxml' ) . "\">\n";
 520+ $text .= "</form>\n";
 521+
 522+ $wgOut->addHTML( $text );
503523 }
504 - $text .= "<br /><p><input type=\"checkbox\" name=\"simplified_format\" /> " . wfMsg( 'dt_viewxml_simplifiedformat' ) . "</p>\n";
505 - $text .= "<input type=\"submit\" value=\"" . wfMsg( 'viewxml' ) . "\">\n";
506 - $text .= "</form>\n";
 524+ }
507525
508 - $wgOut->addHTML( $text );
509 - }
510526 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r109169Follow-up to r109165 - more fixesyaron18:01, 17 January 2012
r109209Follow-up to r109165 - restored htmlspecialchars() call, accidentally deletedyaron20:19, 17 January 2012
r109417Follow-up to r109165 - added 'static' declarations to remaining methodsyaron18:17, 18 January 2012

Comments

#Comment by Nikerabbit (talk | contribs)   18:38, 17 January 2012

Why did you remove htmlspecialchars from:

$link = $skin->makeLinkObj( $title, htmlspecialchars( $title->getText() ) );
#Comment by Yaron K. (talk | contribs)   20:22, 17 January 2012

Oops! I don't know how that happened. Thanks for pointing that out; I just fixed it.

Status & tagging log