Index: trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Time.php |
— | — | @@ -235,9 +235,10 @@ |
236 | 236 | public static function doUnserialize( $serialization ) { |
237 | 237 | $parts = explode( '/', $serialization, 7 ); |
238 | 238 | $values = array(); |
| 239 | + |
239 | 240 | for ( $i = 0; $i < 7; $i += 1 ) { |
240 | 241 | if ( $i < count( $parts ) ) { |
241 | | - if ( is_numeric( ) ) { |
| 242 | + if ( is_numeric( $parts[$i] ) ) { |
242 | 243 | $values[$i] = intval( $parts[$i] ); |
243 | 244 | } else { |
244 | 245 | throw new SMWDataItemException( "Unserialization failed: the string \"$serialization\" is no valid datetime specification." ); |
— | — | @@ -246,10 +247,12 @@ |
247 | 248 | $values[$i] = false; |
248 | 249 | } |
249 | 250 | } |
| 251 | + |
250 | 252 | if ( count( $parts ) <= 1 ) { |
251 | 253 | throw new SMWDataItemException( "Unserialization failed: the string \"$serialization\" is no valid URI." ); |
252 | 254 | } |
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] ); |
254 | 257 | } |
255 | 258 | |
256 | 259 | /** |