mirror of
https://github.com/mrclay/minify.git
synced 2025-08-26 15:24:48 +02:00
@@ -107,9 +107,10 @@ $minify = call_user_func($min_factories['minify'], $cache);
|
|||||||
|
|
||||||
if (!$env->get('f') && $env->get('g') === null) {
|
if (!$env->get('f') && $env->get('g') === null) {
|
||||||
// no spec given
|
// no spec given
|
||||||
|
$msg = '<p>No "f" or "g" parameters were detected.</p>';
|
||||||
|
$url = 'https://github.com/mrclay/minify/blob/master/docs/CommonProblems.wiki.md#long-url-parameters-are-ignored';
|
||||||
$defaults = $minify->getDefaultOptions();
|
$defaults = $minify->getDefaultOptions();
|
||||||
$url = 'https://github.com/mrclay/minify/blob/master/docs/UserGuide.wiki.md#creating-minify-urls';
|
$minify->errorExit($defaults['badRequestHeader'], $url, $msg);
|
||||||
$minify->errorExit($defaults['badRequestHeader'], $url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sourceFactoryOptions = array();
|
$sourceFactoryOptions = array();
|
||||||
|
@@ -428,14 +428,15 @@ class Minify {
|
|||||||
/**
|
/**
|
||||||
* Show an error page
|
* Show an error page
|
||||||
*
|
*
|
||||||
* @param string $header E.g. 'HTTP/1.0 500 Internal Server Error'
|
* @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 $url URL to direct the user to
|
||||||
|
* @param string $msgHtml HTML message for the client
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @internal This is not part of the public API and is subject to change
|
* @internal This is not part of the public API and is subject to change
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
public function errorExit($header, $url)
|
public function errorExit($header, $url = '', $msgHtml = '')
|
||||||
{
|
{
|
||||||
$url = htmlspecialchars($url, ENT_QUOTES);
|
$url = htmlspecialchars($url, ENT_QUOTES);
|
||||||
list(,$h1) = explode(' ', $header, 2);
|
list(,$h1) = explode(' ', $header, 2);
|
||||||
@@ -445,7 +446,12 @@ class Minify {
|
|||||||
header($header, true, $code);
|
header($header, true, $code);
|
||||||
header('Content-Type: text/html; charset=utf-8');
|
header('Content-Type: text/html; charset=utf-8');
|
||||||
echo "<h1>$h1</h1>";
|
echo "<h1>$h1</h1>";
|
||||||
|
if ($msgHtml) {
|
||||||
|
echo $msgHtml;
|
||||||
|
}
|
||||||
|
if ($url) {
|
||||||
echo "<p>Please see <a href='$url'>$url</a>.</p>";
|
echo "<p>Please see <a href='$url'>$url</a>.</p>";
|
||||||
|
}
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user