Permalink
Browse files

Merge pull request #110 from STRML/master

Fix for hashing issue with multiple SASS or CoffeeScript files. Fixes #107, #98
  • Loading branch information...
2 parents 463fa33 + 4a60db7 commit dd48f892b4fa2b726a55695666e3110ef897d5f0 @stefanoverna stefanoverna committed Sep 19, 2012
@@ -44,6 +44,8 @@ protected function asset_hash($file_path) {
foreach ($files as $file) {
$hash_seed[] = $file . date("%U", filemtime($file));
}
+ // Concat original file onto hash seed for uniqueness so each file is unique
+ $hash_seed[] = $file_path;
return md5(join($hash_seed));
}
@@ -39,6 +39,8 @@ protected function asset_hash($file_path) {
foreach ($files as $file) {
$hash_seed[] = $file . date("%U", filemtime($file));
}
+ // Concat original file onto hash seed for uniqueness so each file is unique
+ $hash_seed[] = $file_path;
return md5(join($hash_seed));
}
@@ -40,6 +40,8 @@ protected function asset_hash($file_path) {
foreach ($files as $file) {
$hash_seed[] = $file . date("%U", filemtime($file));
}
+ // Concat original file onto hash seed for uniqueness so each file is unique
+ $hash_seed[] = $file_path;
return md5(join($hash_seed));
}
@@ -92,12 +92,12 @@ protected function comment_line($line) {
*
*/
protected function asset_hash($file_path) {
- // First we get the file content
+ // First we get the file's modified date
$hash_seed = date("%U", filemtime($file_path));
// Then we attach the preferences
foreach ($this->preferences_defaults as $pref => $value) {
- $hash_seed .= $pref . '=' . $this->preference($pref) . ';';
+ $hash_seed .= $pref . '=' . (is_array($this->preference($pref)) ? implode(" ", $this->preference($pref)) : $this->preference($pref)) . ';';
}
return md5($hash_seed);

0 comments on commit dd48f89

Please sign in to comment.