Permalink
Browse files

Fix for issue #98 and #107. Includes fix for #99.

  • Loading branch information...
1 parent 463fa33 commit 4b67bb5af60e573fb3fabda970f2387c66315bc8 @STRML committed Sep 19, 2012
@@ -42,8 +42,10 @@ protected function asset_hash($file_path) {
sort($files);
$hash_seed = array();
foreach ($files as $file) {
- $hash_seed[] = $file . date("%U", filemtime($file));
+ $hash_seed[] = file_get_contents($file);
}
+ // Concat original file onto hash seed for uniqueness so each file is unique
+ $hash_seed[] = file_get_contents($file_path);
return md5(join($hash_seed));
}
@@ -37,8 +37,10 @@ protected function asset_hash($file_path) {
sort($files);
$hash_seed = array();
foreach ($files as $file) {
- $hash_seed[] = $file . date("%U", filemtime($file));
+ $hash_seed[] = file_get_contents($file);
}
+ // Concat original file onto hash seed for uniqueness so each file is unique
+ $hash_seed[] = file_get_contents($file_path);
return md5(join($hash_seed));
}
@@ -38,8 +38,10 @@ protected function asset_hash($file_path) {
sort($files);
$hash_seed = array();
foreach ($files as $file) {
- $hash_seed[] = $file . date("%U", filemtime($file));
+ $hash_seed[] = file_get_contents($file);
}
+ // Concat original file onto hash seed for uniqueness so each file is unique
+ $hash_seed[] = file_get_contents($file_path);
return md5(join($hash_seed));
}
@@ -93,11 +93,11 @@ protected function comment_line($line) {
*/
protected function asset_hash($file_path) {
// First we get the file content
- $hash_seed = date("%U", filemtime($file_path));
+ $hash_seed = file_get_contents($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 4b67bb5

Please sign in to comment.