mirror of
https://github.com/mrclay/minify.git
synced 2025-08-29 16:49:47 +02:00
+ Minify::$uploaderHoursBehind
+ fixed backtrace limit issue in Minify_HTML + default max-age of 30 minutes (instead of 0)
This commit is contained in:
@@ -45,7 +45,7 @@ abstract class Minify_Controller_Base {
|
||||
,'encodeLevel' => 9
|
||||
,'minifierOptions' => array() // no minifier options
|
||||
,'contentTypeCharset' => 'UTF-8'
|
||||
,'maxAge' => null // no Expires/max-age
|
||||
,'maxAge' => 1800 // 30 minutes
|
||||
,'quiet' => false // serve() will send headers and output
|
||||
,'debug' => false
|
||||
|
||||
|
@@ -56,15 +56,15 @@ class Minify_HTML {
|
||||
,array('Minify_HTML', '_removePreCB')
|
||||
, $html);
|
||||
|
||||
// remove leading and trailing ws from each line.
|
||||
// trim each line.
|
||||
// @todo take into account attribute values that span multiple lines.
|
||||
$html = preg_replace('/^\\s*(.*?)\\s*$/m', "$1", $html);
|
||||
$html = preg_replace('/^\\s+|\\s+$/m', '', $html);
|
||||
|
||||
// remove ws around block/undisplayed elements
|
||||
$html = preg_replace('/\\s*(<\\/?(?:area|base(?:font)?|blockquote|body'
|
||||
.'|caption|center|cite|col(?:group)?|dd|dir|div|dl|dt|fieldset|form'
|
||||
.'|frame(?:set)?|h[1-6]|head|hr|html|legend|li|link|map|menu|meta'
|
||||
.'|ol|opt(?:group|ion)|p|param|t(?:able|body|head|d|h||r|foot)|title'
|
||||
.'|ol|opt(?:group|ion)|p|param|t(?:able|body|head|d|h||r|foot|itle)'
|
||||
.'|ul)\\b[^>]*>)/i', '$1', $html);
|
||||
|
||||
// remove ws between and inside elements.
|
||||
|
@@ -51,7 +51,9 @@ class Minify_Source {
|
||||
}
|
||||
$this->_filepath = $spec['filepath'];
|
||||
$this->_id = $spec['filepath'];
|
||||
$this->lastModified = filemtime($spec['filepath']);
|
||||
$this->lastModified = filemtime($spec['filepath'])
|
||||
// offset for Windows uploaders with out of sync clocks
|
||||
+ round(Minify::$uploaderHoursBehind * 3600);
|
||||
} elseif (isset($spec['id'])) {
|
||||
$this->_id = 'id::' . $spec['id'];
|
||||
if (isset($spec['content'])) {
|
||||
|
Reference in New Issue
Block a user