1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-29 08:40:11 +02:00

Be clearer about missing params

Fixes #423
This commit is contained in:
Steve Clay
2015-09-29 15:59:02 -04:00
parent 5793db9098
commit 53a832fd90
2 changed files with 13 additions and 6 deletions

View File

@@ -428,14 +428,15 @@ class Minify {
/**
* Show an error page
*
* @param string $header E.g. 'HTTP/1.0 500 Internal Server Error'
* @param string $url URL to direct the user to
* @param string $header Full header. E.g. 'HTTP/1.0 500 Internal Server Error'
* @param string $url URL to direct the user to
* @param string $msgHtml HTML message for the client
*
* @return void
* @internal This is not part of the public API and is subject to change
* @access private
*/
public function errorExit($header, $url)
public function errorExit($header, $url = '', $msgHtml = '')
{
$url = htmlspecialchars($url, ENT_QUOTES);
list(,$h1) = explode(' ', $header, 2);
@@ -445,7 +446,12 @@ class Minify {
header($header, true, $code);
header('Content-Type: text/html; charset=utf-8');
echo "<h1>$h1</h1>";
echo "<p>Please see <a href='$url'>$url</a>.</p>";
if ($msgHtml) {
echo $msgHtml;
}
if ($url) {
echo "<p>Please see <a href='$url'>$url</a>.</p>";
}
exit;
}