https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114651
Revision: 114651
Author: jeroendedauw
Date: 2012-04-02 12:09:40 +0000 (Mon, 02 Apr 2012)
Log Message:
-----------
fix bug 35643 plus some extra cleanup
Modified Paths:
--------------
trunk/extensions/SemanticMediaWiki/includes/params/SMW_ParamFormat.php
trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php
trunk/extensions/SemanticMediaWiki/specials/URIResolver/SMW_SpecialURIResolver.php
Modified: trunk/extensions/SemanticMediaWiki/includes/params/SMW_ParamFormat.php
===================================================================
--- trunk/extensions/SemanticMediaWiki/includes/params/SMW_ParamFormat.php
2012-04-02 08:53:16 UTC (rev 114650)
+++ trunk/extensions/SemanticMediaWiki/includes/params/SMW_ParamFormat.php
2012-04-02 12:09:40 UTC (rev 114651)
@@ -51,7 +51,7 @@
/**
* Takes a format name, which can be an alias and returns a format name
- * which will be valid for sure. Aliases are resvolved. If the given
+ * which will be valid for sure. Aliases are resolved. If the given
* format name is invalid, the predefined default format will be
returned.
*
* @since 1.6.2
Modified: trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php
===================================================================
--- trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php
2012-04-02 08:53:16 UTC (rev 114650)
+++ trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php
2012-04-02 12:09:40 UTC (rev 114651)
@@ -181,6 +181,7 @@
Generates browsable RDF.',
'smw_exportrdf_lastdate' => 'Do not export pages that were not changed
since the given point in time.',
'smw_exportrdf_submit' => 'Export',
+ 'uriresolver' => 'URIResolver',
// Messages for Properties Special
'properties' => 'Properties',
@@ -217,7 +218,7 @@
Properties that still lack a page are found on the
[[Special:WantedProperties|list of wanted properties]].',
// Name of the URI Resolver Special (no content)
- 'smw_uri_doc' => 'The URI resolver implements the <a
href="http://www.w3.org/2001/tag/issues.html#httpRange-14">W3C TAG finding on
httpRange-14</a>.
+ 'smw_uri_doc' => 'The URI resolver implements the [$1 W3C TAG finding
on httpRange-14].
It takes care that humans do not turn into websites.',
// Messages for ask Special
Modified:
trunk/extensions/SemanticMediaWiki/specials/URIResolver/SMW_SpecialURIResolver.php
===================================================================
---
trunk/extensions/SemanticMediaWiki/specials/URIResolver/SMW_SpecialURIResolver.php
2012-04-02 08:53:16 UTC (rev 114650)
+++
trunk/extensions/SemanticMediaWiki/specials/URIResolver/SMW_SpecialURIResolver.php
2012-04-02 12:09:40 UTC (rev 114651)
@@ -1,19 +1,17 @@
<?php
-/**
- * @file
- * @ingroup SMWSpecialPage
- * @ingroup SpecialPage
- */
/**
- * @author Denny Vrandecic
- *
* This special page solves the URI crisis
* without the need of changing code deep in
* MediaWiki were no hook has ever seen light.
*
+ * @file
+ * @ingroup SpecialPage
+ *
* @ingroup SMWSpecialPage
* @ingroup SpecialPage
+ *
+ * @author Denny Vrandecic
*/
class SMWURIResolver extends SpecialPage {
@@ -28,22 +26,26 @@
global $wgOut;
wfProfileIn( 'SpecialURIResolver::execute (SMW)' );
-
- if ( $query === '' ) {
+
+ if ( is_null( $query ) || trim( $query ) === '' ) {
if ( stristr( $_SERVER['HTTP_ACCEPT'], 'RDF' ) ) {
- $wgOut->redirect( SpecialPage::getTitleFor(
'ExportRDF' )->getFullURL( 'stats=1' ), '303' );
+ $wgOut->redirect( SpecialPage::getTitleFor(
'ExportRDF' )->getFullURL( array( 'stats' => '1' ) ), '303' );
} else {
$this->setHeaders();
- $wgOut->addHTML( '<p>' . wfMsg( 'smw_uri_doc' )
. "</p>" );
+ $wgOut->addHTML(
+ '<p>' .
+ wfMsgExt( 'smw_uri_doc',
'parseinline', 'http://www.w3.org/2001/tag/issues.html#httpRange-14' ) .
+ '</p>'
+ );
}
} else {
$query = SMWExporter::decodeURI( $query );
- $query = str_replace( "_", "%20", $query );
+ $query = str_replace( '_', '%20', $query );
$query = urldecode( $query );
$title = Title::newFromText( $query );
$wgOut->redirect( stristr( $_SERVER['HTTP_ACCEPT'],
'RDF' )
- ? SpecialPage::getTitleFor( 'ExportRDF',
$title->getPrefixedText() )->getFullURL( 'xmlmime=rdf' )
+ ? SpecialPage::getTitleFor( 'ExportRDF',
$title->getPrefixedText() )->getFullURL( array( 'xmlmime' => 'rdf' ) )
: $title->getFullURL(), '303' );
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs