1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-13 17:44:00 +02:00

Source.php now strips leading UTF-8 BOMs and added BOMs to javascript test files to test this, and note in README.

This commit is contained in:
Steve Clay
2008-05-22 15:23:28 +00:00
parent ae22377b26
commit 97eaa576ed
4 changed files with 13 additions and 3 deletions

View File

@@ -78,12 +78,16 @@ class Minify_Source {
*/
public function getContent()
{
return (null !== $this->_filepath)
$content = (null !== $this->_filepath)
? file_get_contents($this->_filepath)
: ((null !== $this->_content)
? $this->_content
: call_user_func($this->_getContentFunc, $this->_id)
);
// remove UTF-8 BOM if present
return (pack("CCC",0xef,0xbb,0xbf) === substr($content, 0, 3))
? substr($content, 3)
: $content;
}
/**