{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/amp-wp/issues/1154","repository_url":"https://api.github.com/repos/Automattic/amp-wp","labels_url":"https://api.github.com/repos/Automattic/amp-wp/issues/1154/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/amp-wp/issues/1154/comments","events_url":"https://api.github.com/repos/Automattic/amp-wp/issues/1154/events","html_url":"https://github.com/Automattic/amp-wp/issues/1154","id":323977322,"number":1154,"title":"preg_match error sanitizer","user":{"login":"nickreale","id":15264445,"avatar_url":"https://avatars1.githubusercontent.com/u/15264445?v=4","gravatar_id":"","url":"https://api.github.com/users/nickreale","html_url":"https://github.com/nickreale","followers_url":"https://api.github.com/users/nickreale/followers","following_url":"https://api.github.com/users/nickreale/following{/other_user}","gists_url":"https://api.github.com/users/nickreale/gists{/gist_id}","starred_url":"https://api.github.com/users/nickreale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickreale/subscriptions","organizations_url":"https://api.github.com/users/nickreale/orgs","repos_url":"https://api.github.com/users/nickreale/repos","events_url":"https://api.github.com/users/nickreale/events{/privacy}","received_events_url":"https://api.github.com/users/nickreale/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-17T11:11:42Z","updated_at":"2018-05-18T18:05:17Z","closed_at":null,"author_association":"NONE","body":"I installed the plugin on several sites. I only seem to have an issue with one site where every amp post is giving this error.\r\n\r\n> Warning: preg_match() expects parameter 2 to be string, array given in /home/molloy6/public_html/familytireandautoservice.com/wp-content/plugins/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php on line 1179\r\n\r\nHere is a link\r\nhttp://www.familytireandautoservice.com/locations/tires-needed-denver-tires/amp/\r\n\r\nI have several hundred posts and it has this error on all I have checked.\r\n\r\nAny ideas or help is appreciated.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Automattic/amp-wp/issues/comments/390287027","html_url":"https://github.com/Automattic/amp-wp/issues/1154#issuecomment-390287027","issue_url":"https://api.github.com/repos/Automattic/amp-wp/issues/1154","id":390287027,"user":{"login":"westonruter","id":134745,"avatar_url":"https://avatars2.githubusercontent.com/u/134745?v=4","gravatar_id":"","url":"https://api.github.com/users/westonruter","html_url":"https://github.com/westonruter","followers_url":"https://api.github.com/users/westonruter/followers","following_url":"https://api.github.com/users/westonruter/following{/other_user}","gists_url":"https://api.github.com/users/westonruter/gists{/gist_id}","starred_url":"https://api.github.com/users/westonruter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/westonruter/subscriptions","organizations_url":"https://api.github.com/users/westonruter/orgs","repos_url":"https://api.github.com/users/westonruter/repos","events_url":"https://api.github.com/users/westonruter/events{/privacy}","received_events_url":"https://api.github.com/users/westonruter/received_events","type":"User","site_admin":false},"created_at":"2018-05-18T18:05:17Z","updated_at":"2018-05-18T18:05:17Z","author_association":"COLLABORATOR","body":"I'm confused. If this is the code in question:\r\n\r\n```php\r\n$url = urldecode( $url );\r\n// Check if the host contains invalid chars.\r\n$url_host = wp_parse_url( $url, PHP_URL_HOST );\r\nif ( $url_host && preg_match( '/[!\"#$%&\\'()*+,\\/:;<=>?@[\\]^`{|}~\\s]/i', $url_host ) ) {\r\n```\r\nThe `urldecode()` function returns a string, and `wp_parse_url()` would return a string here. So I don't see how `$url_host` could be anything other than a string."}}
{"actor":{"display_login":"westonruter"}}