r97258 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97257‎ | r97258 | r97259 >
Date:12:44, 16 September 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_URI.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_URI.php
@@ -67,9 +67,15 @@
6868
6969 /// @todo This should be changed to the spelling getUri().
7070 public function getURI() {
71 - return $this->m_scheme . '://' . $this->m_hierpart .
72 - ( $this->m_query ? '?' . $this->m_query : '' ) .
73 - ( $this->m_fragment ? '#' . $this->m_fragment : '' );
 71+ $schemesWithDoubleslesh = array(
 72+ 'http', 'https', 'ftp'
 73+ );
 74+
 75+ return $this->m_scheme . ':'
 76+ . ( in_array( $this->m_scheme, $schemesWithDoubleslesh ) ? '//' : '' )
 77+ . $this->m_hierpart
 78+ . ( $this->m_query ? '?' . $this->m_query : '' )
 79+ . ( $this->m_fragment ? '#' . $this->m_fragment : '' );
7480 }
7581
7682 public function getScheme() {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97188fix bug 30912jeroendedauw18:33, 15 September 2011