Index: trunk/extensions/Translate/MessageCollection.php |
— | — | @@ -451,7 +451,7 @@ |
452 | 452 | // |
453 | 453 | /* ArrayAccess methods */ |
454 | 454 | public function offsetExists( $offset ) { |
455 | | - return isset( $this->messages[$offset] ); |
| 455 | + return isset( $this->keys[$offset] ); |
456 | 456 | } |
457 | 457 | |
458 | 458 | public function offsetGet( $offset ) { |
— | — | @@ -463,7 +463,7 @@ |
464 | 464 | } |
465 | 465 | |
466 | 466 | public function offsetUnset( $offset ) { |
467 | | - unset( $this->messages[$offset] ); |
| 467 | + unset( $this->keys[$offset] ); |
468 | 468 | } |
469 | 469 | |
470 | 470 | /* Fail fast */ |
— | — | @@ -478,27 +478,27 @@ |
479 | 479 | |
480 | 480 | /* Iterator methods */ |
481 | 481 | public function rewind() { |
482 | | - reset( $this->messages ); |
| 482 | + reset( $this->keys ); |
483 | 483 | } |
484 | 484 | |
485 | 485 | public function current() { |
486 | | - if ( !count( $this->messages ) ) { |
| 486 | + if ( !count( $this->keys ) ) { |
487 | 487 | return false; |
488 | 488 | } |
489 | 489 | |
490 | | - return current( $this->messages ); |
| 490 | + return $this->messages[key( $this->keys )]; |
491 | 491 | } |
492 | 492 | |
493 | 493 | public function key() { |
494 | | - return key( $this->messages ); |
| 494 | + return key( $this->keys ); |
495 | 495 | } |
496 | 496 | |
497 | 497 | public function next() { |
498 | | - return next( $this->messages ); |
| 498 | + return next( $this->keys ); |
499 | 499 | } |
500 | 500 | |
501 | 501 | public function valid() { |
502 | | - return $this->current() !== false; |
| 502 | + return isset( $this->messages[key( $this->keys )] ); |
503 | 503 | } |
504 | 504 | |
505 | 505 | public function count() { |