summaryrefslogtreecommitdiff
path: root/plugins/Irc/extlib/phergie/Phergie/Plugin/Iterator.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Irc/extlib/phergie/Phergie/Plugin/Iterator.php')
-rw-r--r--plugins/Irc/extlib/phergie/Phergie/Plugin/Iterator.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/Irc/extlib/phergie/Phergie/Plugin/Iterator.php b/plugins/Irc/extlib/phergie/Phergie/Plugin/Iterator.php
index 596330071..d61096298 100644
--- a/plugins/Irc/extlib/phergie/Phergie/Plugin/Iterator.php
+++ b/plugins/Irc/extlib/phergie/Phergie/Plugin/Iterator.php
@@ -47,6 +47,22 @@ class Phergie_Plugin_Iterator extends FilterIterator
protected $methods = array();
/**
+ * Overrides the parent constructor to reset the internal iterator's
+ * pointer to the current item, which the parent class errantly does not
+ * do.
+ *
+ * @param Iterator $iterator Iterator to filter
+ *
+ * @return void
+ * @link http://bugs.php.net/bug.php?id=52560
+ */
+ public function __construct(Iterator $iterator)
+ {
+ parent::__construct($iterator);
+ $this->rewind();
+ }
+
+ /**
* Adds to a list of plugins to exclude when iterating.
*
* @param mixed $plugins String containing the short name of a single