Skip to content

Commit

Permalink
Merge pull request #202
Browse files Browse the repository at this point in the history
dev
  • Loading branch information
leonardosahon authored Nov 21, 2024
2 parents 9ead807 + 42112b3 commit 3be5a62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Core/View/ViewEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,17 @@ private function skeleton_body() : string

ob_start();

// TODO: Find a way to render more than 1.5mb of HTML page
if(empty($matches['html_content'])) {
$length = LayFn::num_format(strlen($body), 6) . "B";

Exception::throw_exception(
"It seems the html_content of the page is empty. Maybe you are rendering a page that is very large. Body Size: $length",
"ViewEngine::PageTooLarge"
"ViewEngine::PageTooLarge",
false
);

$matches['html_content'] = ["<h1 style='padding: 2rem'>HTML Page Exceeds Limit. Current Page Size is: $length</h1>"];
}

echo implode($matches['html_content']);
Expand Down
4 changes: 4 additions & 0 deletions src/Libs/LayDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,8 @@ public static function greater(string|int $datetime_earlier, string|int $datetim
return self::date($datetime_latest, figure: true) > self::date($datetime_earlier, figure: true);
}

public static function expired(string|int $expiry_date) : bool
{
return self::greater($expiry_date);
}
}

0 comments on commit 3be5a62

Please sign in to comment.