mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-01 13:24:10 +01:00
don´t hardcode /tmp
This commit is contained in:
parent
13ada1a994
commit
9fb7efb272
@ -40,7 +40,7 @@ if (!isset($_GET['id'])) {
|
||||
bailOut(OC_Contacts_App::$l10n->t('No contact ID was submitted.'));
|
||||
}
|
||||
|
||||
$tmpfname = tempnam("/tmp", "occOrig");
|
||||
$tmpfname = tempnam(get_temp_dir(), "occOrig");
|
||||
$contact = OC_Contacts_App::getContactVCard($_GET['id']);
|
||||
$image = new OC_Image();
|
||||
if(!$image) {
|
||||
|
@ -42,7 +42,7 @@ if(!isset($_GET['path'])) {
|
||||
}
|
||||
|
||||
$localpath = OC_Filesystem::getLocalFile($_GET['path']);
|
||||
$tmpfname = tempnam("/tmp", "occOrig");
|
||||
$tmpfname = tempnam(get_temp_dir(), "occOrig");
|
||||
|
||||
if(!file_exists($localpath)) {
|
||||
bailOut(OC_Contacts_App::$l10n->t('File doesn\'t exist:').$localpath);
|
||||
|
@ -71,7 +71,7 @@ if(file_exists($tmp_path)) {
|
||||
OCP\Util::writeLog('contacts','savecrop.php, x: '.$x1.' y: '.$y1.' w: '.$w.' h: '.$h, OCP\Util::DEBUG);
|
||||
if($image->crop($x1, $y1, $w, $h)) {
|
||||
if(($image->width() <= 200 && $image->height() <= 200) || $image->resize(200)) {
|
||||
$tmpfname = tempnam("/tmp", "occCropped"); // create a new file because of caching issues.
|
||||
$tmpfname = tempnam(get_temp_dir(), "occCropped"); // create a new file because of caching issues.
|
||||
if($image->save($tmpfname)) {
|
||||
unlink($tmp_path);
|
||||
$card = OC_Contacts_App::getContactVCard($id);
|
||||
|
@ -67,7 +67,7 @@ if($error !== UPLOAD_ERR_OK) {
|
||||
}
|
||||
$file=$_FILES['importfile'];
|
||||
|
||||
$tmpfname = tempnam("/tmp", "occOrig");
|
||||
$tmpfname = tempnam(get_temp_dir(), "occOrig");
|
||||
if(file_exists($file['tmp_name'])) {
|
||||
if($view->file_put_contents('/'.$tmpfile, file_get_contents($file['tmp_name']))) {
|
||||
debug($fn.' uploaded');
|
||||
|
@ -46,7 +46,7 @@ if ($fn) {
|
||||
exit();
|
||||
}
|
||||
$id = $_GET['id'];
|
||||
$tmpfname = tempnam('/tmp', 'occOrig');
|
||||
$tmpfname = tempnam(get_temp_dir(), 'occOrig');
|
||||
file_put_contents($tmpfname, file_get_contents('php://input'));
|
||||
debug($tmpfname.' uploaded');
|
||||
$image = new OC_Image();
|
||||
@ -93,7 +93,7 @@ if($error !== UPLOAD_ERR_OK) {
|
||||
}
|
||||
$file=$_FILES['imagefile'];
|
||||
|
||||
$tmpfname = tempnam("/tmp", "occOrig");
|
||||
$tmpfname = tempnam(get_temp_dir(), "occOrig");
|
||||
if(file_exists($file['tmp_name'])) {
|
||||
$image = new OC_Image();
|
||||
if($image->loadFromFile($file['tmp_name'])) {
|
||||
|
Loading…
Reference in New Issue
Block a user