{"action":"closed","issue":{"url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/issues/37","repository_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad","labels_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/issues/37/comments","events_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/issues/37/events","html_url":"https://github.com/smstw/windwalker-joomla-rad/issues/37","id":65378695,"number":37,"title":"AssetHelper constructor 的 $path 型態有漏洞","user":{"login":"LeoOnTheEarth","id":726108,"avatar_url":"https://avatars.githubusercontent.com/u/726108?v=3","gravatar_id":"","url":"https://api.github.com/users/LeoOnTheEarth","html_url":"https://github.com/LeoOnTheEarth","followers_url":"https://api.github.com/users/LeoOnTheEarth/followers","following_url":"https://api.github.com/users/LeoOnTheEarth/following{/other_user}","gists_url":"https://api.github.com/users/LeoOnTheEarth/gists{/gist_id}","starred_url":"https://api.github.com/users/LeoOnTheEarth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeoOnTheEarth/subscriptions","organizations_url":"https://api.github.com/users/LeoOnTheEarth/orgs","repos_url":"https://api.github.com/users/LeoOnTheEarth/repos","events_url":"https://api.github.com/users/LeoOnTheEarth/events{/privacy}","received_events_url":"https://api.github.com/users/LeoOnTheEarth/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/labels/Backlog","name":"Backlog","color":"fbca04"},{"url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-31T06:31:34Z","updated_at":"2016-02-06T15:26:30Z","closed_at":"2016-02-06T15:26:30Z","body":"```php\r\n/**\r\n * Constructor.\r\n *\r\n * @param string             $name  The instance name.\r\n * @param \\SplPriorityQueue  $paths Paths to scan assets.\r\n */\r\npublic function __construct($name = 'windwalker', $paths = null)\r\n{\r\n\t$this->name = $name;\r\n\r\n\t// Setup dependencies.\r\n\t$this->paths = $paths ? : new \\SplPriorityQueue((array) $paths);\r\n\r\n\t$this->registerPaths(false);\r\n}\r\n```\r\n\r\n`$paths` phpdoc 上是被定義成 `SplPriorityQueue` 物件\r\n但是在建構子會被強制轉型成 `array`\r\n可能要討論一下 `$paths` 明確的定義\r\n是否只允許 `SplPriorityQueue` 與 `null` 兩種型態\r\n\r\n另外一點是，若 `$paths` 不是帶 `SplPriorityQueue` 與 `null`\r\n在進行 `$this->registerPaths(false);` 時會因為 `$this->paths` 不是 `SplPriorityQueue` 而出錯"}}