r25534 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25533‎ | r25534 | r25535 >
Date:10:02, 5 September 2007
Author:mkroetzsch
Status:old
Tags:
Comment:
Provide rdf-mime results to RDF-requests
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/URIResolver/SMW_SpecialURIResolver.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/URIResolver/SMW_SpecialURIResolver.php
@@ -25,26 +25,26 @@
2626 function execute($query = '') {
2727 global $wgOut, $smwgIP;
2828 wfProfileIn('SpecialURIResolver::execute (SMW)');
29 - require_once( $smwgIP . '/specials/ExportRDF/SMW_SpecialExportRDF.php' );
3029 if ('' == $query) {
3130 $wgOut->addHTML(wfMsg('smw_uri_doc'));
3231 } else {
 32+ /// TODO: the next (large) include is used for just a single function, I think -- mak
 33+ require_once( $smwgIP . '/specials/ExportRDF/SMW_SpecialExportRDF.php' );
3334 $wgOut->disable();
3435
3536 $query = ExportRDF::makeURIfromXMLExportId($query);
3637 $query = str_replace( "_", "%20", $query );
3738 $query = urldecode($query);
3839 $title = Title::newFromText($query);
39 - $t = $title->getFullURL();
4040
41 - $rdftitle = Title::newFromText('ExportRDF', NS_SPECIAL);
42 - $s = $rdftitle->getFullURL() . "/" . $title->getPrefixedURL();
43 -
4441 header('HTTP/1.1 303 See Other');
45 - if (stristr($_SERVER['HTTP_ACCEPT'], 'RDF'))
 42+ if (stristr($_SERVER['HTTP_ACCEPT'], 'RDF')) {
 43+ $s = Skin::makeSpecialUrlSubpage('ExportRDF', $title->getPrefixedURL(), 'xmlmime=rdf');
4644 header('Location: ' . $s);
47 - else
 45+ } else {
 46+ $t = $title->getFullURL();
4847 header('Location: ' . $t);
 48+ }
4949 }
5050 wfProfileOut('SpecialURIResolver::execute (SMW)');
5151 }

Status & tagging log