X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fdom-crawler%2FField%2FFileFormField.php;h=3288fc135a77846539368271803af23d87b969c2;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=0e0f94347a5ee8b5737e991de32ec40ec4cc24e5;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/dom-crawler/Field/FileFormField.php b/vendor/symfony/dom-crawler/Field/FileFormField.php index 0e0f94347..3288fc135 100644 --- a/vendor/symfony/dom-crawler/Field/FileFormField.php +++ b/vendor/symfony/dom-crawler/Field/FileFormField.php @@ -28,7 +28,7 @@ class FileFormField extends FormField public function setErrorCode($error) { $codes = array(UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_PARTIAL, UPLOAD_ERR_NO_FILE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_EXTENSION); - if (!in_array($error, $codes)) { + if (!\in_array($error, $codes)) { throw new \InvalidArgumentException(sprintf('The error code %s is not valid.', $error)); } @@ -59,7 +59,7 @@ class FileFormField extends FormField $name = $info['basename']; // copy to a tmp location - $tmp = sys_get_temp_dir().'/'.sha1(uniqid(mt_rand(), true)); + $tmp = sys_get_temp_dir().'/'.strtr(substr(base64_encode(hash('sha256', uniqid(mt_rand(), true), true)), 0, 7), '/', '_'); if (array_key_exists('extension', $info)) { $tmp .= '.'.$info['extension']; }