From: Michael J. Rubinsky Date: Sun, 28 Dec 2008 23:34:10 +0000 (-0500) Subject: Validate method name with requested query type. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f4ded25a38328d7a7c301d933f90fbd3b6e8cba0;p=horde.git Validate method name with requested query type. --- diff --git a/framework/Service_Vimeo/lib/Horde/Service/Vimeo/Simple.php b/framework/Service_Vimeo/lib/Horde/Service/Vimeo/Simple.php index cefa3f425..e4ad704d8 100644 --- a/framework/Service_Vimeo/lib/Horde/Service/Vimeo/Simple.php +++ b/framework/Service_Vimeo/lib/Horde/Service/Vimeo/Simple.php @@ -58,6 +58,11 @@ class Horde_Service_Vimeo_Request { protected $_method; protected $_type; + protected $_methodTypes = array('user' => array('clips', 'likes', 'info', 'appears_in', 'all_clips', 'subscriptions', 'albums', 'channels', 'groups', 'contacts_clips', 'contacts_like'), + 'group' => array('clips', 'users', 'info'), + 'channel' => array('clips', 'info'), + 'album' => array('clips', 'info')); + public function __construct($args = array()) { if (count($args) && !empty($args['type'])) { @@ -90,12 +95,11 @@ class Horde_Service_Vimeo_Request { */ public function __call($name, $args) { - switch ($name) { - case 'clips': - // ->clips() - $this->_method = $name; - return $this; - } + if (!in_array($name, $this->_methodType[$this->_type])) { + return; + } + $this->_method = $name; + return $this; } public function embed($options)