From b9bdad51658a81e044957d3c327aa3ff1cbad408 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 13 Apr 2012 22:59:47 +0200 Subject: make sure temporary files are being removed, fixes oc-450 --- lib/files.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/files.php') diff --git a/lib/files.php b/lib/files.php index 051cfd4b81c..01558a68588 100644 --- a/lib/files.php +++ b/lib/files.php @@ -63,7 +63,7 @@ class OC_Files { $executionTime = intval(ini_get('max_execution_time')); set_time_limit(0); $zip = new ZipArchive(); - $filename = get_temp_dir().'/ownCloud_'.mt_rand(10000,99999).'.zip'; + $filename = OC_Helper::tmpFile('.zip'); if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==TRUE) { exit("cannot open <$filename>\n"); } @@ -84,7 +84,7 @@ class OC_Files { $executionTime = intval(ini_get('max_execution_time')); set_time_limit(0); $zip = new ZipArchive(); - $filename = get_temp_dir().'/ownCloud_'.mt_rand(10000,99999).'.zip'; + $filename = OC_Helper::tmpFile('.zip'); if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==TRUE) { exit("cannot open <$filename>\n"); } -- cgit v1.2.3 From b1bcc60d83866627b1b28a0eda336e0f246dbe8e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sat, 14 Apr 2012 16:44:15 +0200 Subject: reuse OC_L10N objects --- apps/admin_dependencies_chk/appinfo/app.php | 2 +- apps/admin_dependencies_chk/settings.php | 2 +- apps/bookmarks/bookmarksHelper.php | 2 +- apps/bookmarks/templates/bookmarklet.php | 2 +- apps/calendar/ajax/calendar/new.form.php | 1 - apps/calendar/ajax/calendar/overview.php | 2 +- apps/calendar/ajax/event/delete.php | 2 -- apps/calendar/ajax/event/new.php | 2 -- apps/calendar/ajax/events.php | 2 +- apps/calendar/ajax/import/dialog.php | 1 - apps/calendar/ajax/settings/guesstimezone.php | 2 +- apps/calendar/ajax/settings/settimezone.php | 2 +- apps/calendar/appinfo/app.php | 2 +- apps/calendar/lib/app.php | 2 +- apps/contacts/lib/app.php | 2 +- apps/gallery/appinfo/app.php | 2 +- apps/gallery/templates/index.php | 2 +- apps/gallery/templates/view_album.php | 2 +- apps/media/appinfo/app.php | 2 +- core/ajax/translations.php | 2 +- core/lostpassword/index.php | 2 +- core/strings.php | 2 +- files/ajax/upload.php | 2 +- files/appinfo/app.php | 2 +- lib/app.php | 2 +- lib/files.php | 4 ++-- lib/json.php | 6 +++--- lib/l10n.php | 20 ++++++++++++++++++++ lib/template.php | 4 ++-- settings/ajax/lostpassword.php | 2 +- settings/ajax/openid.php | 2 +- settings/ajax/setlanguage.php | 2 +- settings/personal.php | 2 +- 33 files changed, 52 insertions(+), 38 deletions(-) (limited to 'lib/files.php') diff --git a/apps/admin_dependencies_chk/appinfo/app.php b/apps/admin_dependencies_chk/appinfo/app.php index e2169b5dd77..f282b103c87 100644 --- a/apps/admin_dependencies_chk/appinfo/app.php +++ b/apps/admin_dependencies_chk/appinfo/app.php @@ -1,5 +1,5 @@ 14, diff --git a/apps/admin_dependencies_chk/settings.php b/apps/admin_dependencies_chk/settings.php index ce90dd604ca..ea1ce9fb3dc 100644 --- a/apps/admin_dependencies_chk/settings.php +++ b/apps/admin_dependencies_chk/settings.php @@ -20,7 +20,7 @@ * License along with this library. If not, see . * */ -$l=new OC_L10N('admin_dependencies_chk'); +$l=OC_L10N::get('admin_dependencies_chk'); $tmpl = new OC_Template( 'admin_dependencies_chk', 'settings'); $modules = array(); diff --git a/apps/bookmarks/bookmarksHelper.php b/apps/bookmarks/bookmarksHelper.php index 7ada69014fb..f1464be79de 100644 --- a/apps/bookmarks/bookmarksHelper.php +++ b/apps/bookmarks/bookmarksHelper.php @@ -94,7 +94,7 @@ function addBookmark($url, $title, $tags='') { } if(empty($title)) { - $l = new OC_L10N('bookmarks'); + $l = OC_L10N::get('bookmarks'); $title = $l->t('unnamed'); } diff --git a/apps/bookmarks/templates/bookmarklet.php b/apps/bookmarks/templates/bookmarklet.php index 5ea67f04df2..f7074462a79 100644 --- a/apps/bookmarks/templates/bookmarklet.php +++ b/apps/bookmarks/templates/bookmarklet.php @@ -1,7 +1,7 @@ ' . $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:') . '' . '' . $l->t('Read later') . ''; diff --git a/apps/calendar/ajax/calendar/new.form.php b/apps/calendar/ajax/calendar/new.form.php index 6e7423cbe92..fa014351f77 100644 --- a/apps/calendar/ajax/calendar/new.form.php +++ b/apps/calendar/ajax/calendar/new.form.php @@ -7,7 +7,6 @@ */ require_once('../../../../lib/base.php'); -$l10n = new OC_L10N('calendar'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); $calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions(); diff --git a/apps/calendar/ajax/calendar/overview.php b/apps/calendar/ajax/calendar/overview.php index 2f73f5d0710..dd55f3e018f 100644 --- a/apps/calendar/ajax/calendar/overview.php +++ b/apps/calendar/ajax/calendar/overview.php @@ -7,7 +7,7 @@ */ require_once('../../../../lib/base.php'); -$l10n = new OC_L10N('calendar'); +$l10n = OC_L10N::get('calendar'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); $output = new OC_TEMPLATE("calendar", "part.choosecalendar"); diff --git a/apps/calendar/ajax/event/delete.php b/apps/calendar/ajax/event/delete.php index 862dec6bf5b..5fc12900ef3 100644 --- a/apps/calendar/ajax/event/delete.php +++ b/apps/calendar/ajax/event/delete.php @@ -7,8 +7,6 @@ */ require_once('../../../../lib/base.php'); -$l10n = new OC_L10N('calendar'); - OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/event/new.php b/apps/calendar/ajax/event/new.php index 59fda79da73..7070bbf05d7 100644 --- a/apps/calendar/ajax/event/new.php +++ b/apps/calendar/ajax/event/new.php @@ -8,8 +8,6 @@ require_once('../../../../lib/base.php'); -$l10n = new OC_L10N('calendar'); - OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index c62f93c540e..d053df2e4c1 100755 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -8,7 +8,7 @@ require_once ('../../../lib/base.php'); require_once('when/When.php'); -$l = new OC_L10N('calendar'); +$l = OC_L10N::get('calendar'); $unnamed = $l->t('unnamed'); function create_return_event($event, $vevent){ $return_event = array(); diff --git a/apps/calendar/ajax/import/dialog.php b/apps/calendar/ajax/import/dialog.php index 2e002092150..16ec54d14a2 100644 --- a/apps/calendar/ajax/import/dialog.php +++ b/apps/calendar/ajax/import/dialog.php @@ -9,7 +9,6 @@ require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_Util::checkAppEnabled('calendar'); -$l10n = new OC_L10N('calendar'); $tmpl = new OC_Template('calendar', 'part.import'); $tmpl->assign('path', $_POST['path']); $tmpl->assign('filename', $_POST['filename']); diff --git a/apps/calendar/ajax/settings/guesstimezone.php b/apps/calendar/ajax/settings/guesstimezone.php index d45a70e1ce3..c02b8d10b8d 100755 --- a/apps/calendar/ajax/settings/guesstimezone.php +++ b/apps/calendar/ajax/settings/guesstimezone.php @@ -10,7 +10,7 @@ require_once('../../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('calendar'); -$l = new OC_L10N('calendar'); +$l = OC_L10N::get('calendar'); $lat = $_GET['lat']; $lng = $_GET['long']; diff --git a/apps/calendar/ajax/settings/settimezone.php b/apps/calendar/ajax/settings/settimezone.php index c639753fe2f..8dda28335f7 100644 --- a/apps/calendar/ajax/settings/settimezone.php +++ b/apps/calendar/ajax/settings/settimezone.php @@ -9,7 +9,7 @@ // Init owncloud require_once('../../../../lib/base.php'); -$l=new OC_L10N('calendar'); +$l=OC_L10N::get('calendar'); // Check if we are a user OC_JSON::checkLoggedIn(); diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php index f297c4d16d4..1fece8077ac 100644 --- a/apps/calendar/appinfo/app.php +++ b/apps/calendar/appinfo/app.php @@ -1,5 +1,5 @@ 20, diff --git a/apps/gallery/templates/index.php b/apps/gallery/templates/index.php index 9bec5db1b91..cf654b68c0b 100644 --- a/apps/gallery/templates/index.php +++ b/apps/gallery/templates/index.php @@ -7,7 +7,7 @@ OC_Util::addStyle('files', 'files'); OC_Util::addScript('files_imageviewer', 'jquery.mousewheel-3.0.4.pack'); OC_Util::addScript('files_imageviewer', 'jquery.fancybox-1.3.4.pack'); OC_Util::addStyle( 'files_imageviewer', 'jquery.fancybox-1.3.4' ); -$l = new OC_L10N('gallery'); +$l = OC_L10N::get('gallery'); ?>
diff --git a/apps/gallery/templates/view_album.php b/apps/gallery/templates/view_album.php index 6b513a672d5..f938e487954 100644 --- a/apps/gallery/templates/view_album.php +++ b/apps/gallery/templates/view_album.php @@ -5,7 +5,7 @@ OC_Util::addScript('gallery', 'album_cover'); OC_Util::addScript('files_imageviewer', 'jquery.mousewheel-3.0.4.pack'); OC_Util::addScript('files_imageviewer', 'jquery.fancybox-1.3.4.pack'); OC_Util::addStyle( 'files_imageviewer', 'jquery.fancybox-1.3.4' ); -$l = new OC_L10N('gallery'); +$l = OC_L10N::get('gallery'); ?>