function _photos_rename in Album Photos 6.2
Same name and namespace in other branches
- 7.3 photos.module \_photos_rename()
3 calls to _photos_rename()
- photos_swfu_upload in photos_swfu/
photos_swfu.module - photos_upload_form_submit in inc/
photos.edit.inc - _photos_unzip in ./
photos.module
File
- ./
photos.module, line 1309
Code
function _photos_rename($name = 0, $ext = 0) {
if (variable_get('photos_rname', 0)) {
if ($name) {
return round(rand(15770, 967049700)) . time() . '.' . ($ext ? $ext : end(explode('.', $name)));
}
if (!empty($_FILES['files'])) {
foreach ($_FILES['files']['name'] as $field => $filename) {
$_FILES['files']['name'][$field] = round(rand(15770, 967049700)) . time() . '.' . ($ext ? $ext : end(explode('.', $filename)));
}
}
}
else {
if ($name) {
return $name;
}
}
}