From d67e76f4b512b85d128e673a0bfcb3ca07f64788 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Wed, 13 Dec 2017 09:08:12 -0800 Subject: [PATCH] more strict match for XKCD comics allows the XKCD XML feeds to be parsed with the feed parser --- lib/XRay/Formats/XKCD.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/XRay/Formats/XKCD.php b/lib/XRay/Formats/XKCD.php index d7dc687..15bec65 100644 --- a/lib/XRay/Formats/XKCD.php +++ b/lib/XRay/Formats/XKCD.php @@ -12,7 +12,7 @@ class XKCD extends Format { } public static function matches($url) { - return self::matches_host($url) && parse_url($url, PHP_URL_PATH) != '/'; + return self::matches_host($url) && preg_match('/^\/\d+\/$/', ''.parse_url($url, PHP_URL_PATH)); } public static function parse($html, $url) {