comparison vendor/symfony/dom-crawler/Field/FileFormField.php @ 12:7a779792577d

Update Drupal core to v8.4.5 (via Composer)
author Chris Cannam
date Fri, 23 Feb 2018 15:52:07 +0000
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
11:bfffd8d7479a 12:7a779792577d
57 $size = filesize($value); 57 $size = filesize($value);
58 $info = pathinfo($value); 58 $info = pathinfo($value);
59 $name = $info['basename']; 59 $name = $info['basename'];
60 60
61 // copy to a tmp location 61 // copy to a tmp location
62 $tmp = sys_get_temp_dir().'/'.sha1(uniqid(mt_rand(), true)); 62 $tmp = sys_get_temp_dir().'/'.strtr(substr(base64_encode(hash('sha256', uniqid(mt_rand(), true), true)), 0, 7), '/', '_');
63 if (array_key_exists('extension', $info)) { 63 if (array_key_exists('extension', $info)) {
64 $tmp .= '.'.$info['extension']; 64 $tmp .= '.'.$info['extension'];
65 } 65 }
66 if (is_file($tmp)) { 66 if (is_file($tmp)) {
67 unlink($tmp); 67 unlink($tmp);