r93185 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93184‎ | r93185 | r93186 >
Date:14:30, 26 July 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fix cp fail
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Time.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Time.php
@@ -235,9 +235,10 @@
236236 public static function doUnserialize( $serialization ) {
237237 $parts = explode( '/', $serialization, 7 );
238238 $values = array();
 239+
239240 for ( $i = 0; $i < 7; $i += 1 ) {
240241 if ( $i < count( $parts ) ) {
241 - if ( is_numeric( ) ) {
 242+ if ( is_numeric( $parts[$i] ) ) {
242243 $values[$i] = intval( $parts[$i] );
243244 } else {
244245 throw new SMWDataItemException( "Unserialization failed: the string \"$serialization\" is no valid datetime specification." );
@@ -246,10 +247,12 @@
247248 $values[$i] = false;
248249 }
249250 }
 251+
250252 if ( count( $parts ) <= 1 ) {
251253 throw new SMWDataItemException( "Unserialization failed: the string \"$serialization\" is no valid URI." );
252254 }
253 - return new SMWDITime( $values[0], $values[1], $values[2], $values[3], $values[4], $values[5], $values[6] );
 255+
 256+ return new self( $values[0], $values[1], $values[2], $values[3], $values[4], $values[5], $values[6] );
254257 }
255258
256259 /**