aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/contents.php4
-rw-r--r--lib/simplehtmldom/simple_html_dom.php5
2 files changed, 2 insertions, 7 deletions
diff --git a/lib/contents.php b/lib/contents.php
index 893a3512..cc9542a9 100644
--- a/lib/contents.php
+++ b/lib/contents.php
@@ -142,7 +142,6 @@ function getContents(
* when returning plaintext.
* @param string $defaultSpanText Specifies the replacement text for `<span />`
* tags when returning plaintext.
- * @return false|simple_html_dom Contents as simplehtmldom object.
*/
function getSimpleHTMLDOM(
$url,
@@ -154,11 +153,12 @@ function getSimpleHTMLDOM(
$stripRN = true,
$defaultBRText = DEFAULT_BR_TEXT,
$defaultSpanText = DEFAULT_SPAN_TEXT
-) {
+): \simple_html_dom {
$html = getContents($url, $header ?? [], $opts ?? []);
if ($html === '') {
throw new \Exception('Unable to parse dom because the http response was the empty string');
}
+
return str_get_html(
$html,
$lowercase,
diff --git a/lib/simplehtmldom/simple_html_dom.php b/lib/simplehtmldom/simple_html_dom.php
index 3fc95760..170f6fb0 100644
--- a/lib/simplehtmldom/simple_html_dom.php
+++ b/lib/simplehtmldom/simple_html_dom.php
@@ -118,11 +118,6 @@ function str_get_html(
throw new \Exception('Refusing to parse too big input');
}
- if (empty($str) || strlen($str) > MAX_FILE_SIZE) {
- $dom->clear();
- return false;
- }
-
return $dom->load($str, $lowercase, $stripRN);
}