Create a tempnam substitute that safely creates files with a given extension.

This commit is contained in:
Chad Parry
2011-04-23 21:19:47 -06:00
parent 97400b7815
commit 5c9a3b3f39
4 changed files with 115 additions and 2 deletions

View File

@@ -36,8 +36,8 @@ class Quick_Controller extends Controller {
}
if ($degrees) {
$tmpfile = tempnam(TMPPATH, "rotate") . "." .
pathinfo($item->file_path(), PATHINFO_EXTENSION);
$tmpfile = system::tempnam(TMPPATH, "rotate",
"." . pathinfo($item->file_path(), PATHINFO_EXTENSION));
gallery_graphics::rotate($item->file_path(), $tmpfile, array("degrees" => $degrees), $item);
$item->set_data_file($tmpfile);
$item->save();