Révision 560c3060
Ajouté par Julien Enselme il y a plus de 8 ans
drupal7/sites/all/modules/ctools/includes/css.inc | ||
---|---|---|
172 | 172 |
// @todo Is this slow? Does it matter if it is? |
173 | 173 |
$filename = $path . '/' . md5($css) . '.css'; |
174 | 174 |
|
175 |
// This will do renames if the file already exists, ensuring we don't |
|
176 |
// accidentally overwrite other files who share the same md5. Yes this |
|
177 |
// is a very miniscule chance but it's safe. |
|
178 |
$filename = file_unmanaged_save_data($css, $filename); |
|
175 |
// Generally md5 is considered unique enough to sign file downloads. |
|
176 |
// So this replaces already existing files based on the assumption that two |
|
177 |
// files with the same hash are identical content wise. |
|
178 |
// If we rename, the cache folder can potentially fill up with thousands of |
|
179 |
// files with the same content. |
|
180 |
$filename = file_unmanaged_save_data($css, $filename, FILE_EXISTS_REPLACE); |
|
179 | 181 |
|
180 | 182 |
return $filename; |
181 | 183 |
} |
Formats disponibles : Unified diff
Update ctools 1.7 -> 1.9