From 22e8f8b4aa9e7a157cfaffa7d0755c00bdb22759 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Tue, 6 Nov 2018 18:11:16 +0100 Subject: [PATCH] [RssBridge] Skip searching vendor files Vendor files (simple_html_dom.php and urljoin.php) are included in the repository and therefore shipped with all releases. If one of the files is missing, either the repository or the release is incomplete. PHP will generate error messages if either of the files is missing, so there is no need to check availability manually unless it is done for all files (which doesn't make sense because they are part of the repository). --- lib/RssBridge.php | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/lib/RssBridge.php b/lib/RssBridge.php index 5e85da2a..dea2ec4c 100644 --- a/lib/RssBridge.php +++ b/lib/RssBridge.php @@ -24,26 +24,8 @@ require __DIR__ . '/html.php'; require __DIR__ . '/error.php'; require __DIR__ . '/contents.php'; -$vendorLibSimpleHtmlDom = PATH_VENDOR . '/simplehtmldom/simple_html_dom.php'; -if(!file_exists($vendorLibSimpleHtmlDom)) { - throw new \HttpException('"PHP Simple HTML DOM Parser" library is missing. - Get it from http://simplehtmldom.sourceforge.net and place the script "simple_html_dom.php" in ' - . substr(PATH_VENDOR, 4) - . '/simplehtmldom/', - 500); -} -require_once $vendorLibSimpleHtmlDom; - -$vendorLibPhpUrlJoin = PATH_VENDOR . '/php-urljoin/src/urljoin.php'; -if(!file_exists($vendorLibPhpUrlJoin)) { - throw new \HttpException('"php-urljoin" library is missing. - Get it from https://github.com/fluffy-critter/php-urljoin and place the script "urljoin.php" in ' - . substr(PATH_VENDOR, 4) - . '/php-urljoin/src/', - 500); -} -require_once $vendorLibPhpUrlJoin; - +require_once PATH_VENDOR . '/simplehtmldom/simple_html_dom.php'; +require_once PATH_VENDOR . '/php-urljoin/src/urljoin.php'; /* Example use