Skip to content

Commit b41e5dd

Browse files
committed
Fix when open_basedir restriction is in effect
Using an empty string as `$dir` parameter will not work if an open_basedir restriction is in effect. See first comment on the [manual page](http://php.net/manual/fr/function.tempnam.php).
1 parent 683a80e commit b41e5dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ImageResize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public function save($filename, $image_type = null, $quality = null, $permission
213213
*/
214214
public function getImageAsString($image_type = null, $quality = null)
215215
{
216-
$string_temp = tempnam('', '');
216+
$string_temp = tempnam(sys_get_temp_dir(), '');
217217

218218
$this->save($string_temp, $image_type, $quality);
219219

0 commit comments

Comments
 (0)