diff --git a/phpBB/includes/event/data.php b/phpBB/includes/event/data.php index 62e2f2312e..5780ddbfff 100644 --- a/phpBB/includes/event/data.php +++ b/phpBB/includes/event/data.php @@ -36,6 +36,16 @@ class phpbb_event_data extends Event implements ArrayAccess return $this->data; } + /* + * Returns data filtered to only include specified keys. + * + * This effectively discards any keys added to data by hooks. + */ + public function get_data_filtered($keys) + { + return array_intersect_key($this->data, array_flip($keys)); + } + public function offsetExists($offset) { return isset($this->data[$offset]);