diff options
author | patdenice <patdenice@piwigo.org> | 2008-11-24 22:37:13 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2008-11-24 22:37:13 +0000 |
commit | d23fa6c579143c14599cba03a4a7e049802ad8cf (patch) | |
tree | 3278376c1948f241a701fdf651171465545c5e44 /plugins/LocalFilesEditor/admin.php | |
parent | 5f9b237e475ff035bfdea80bda49fe49acd17916 (diff) |
merge -c2906 from trunk to branch 2.0.
- Replace all #content by .content in Sylvia theme.css.
- In LocalFiles Editor, show error message when creating new template file with empty filename.
git-svn-id: http://piwigo.org/svn/branches/2.0@2907 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'plugins/LocalFilesEditor/admin.php')
-rw-r--r-- | plugins/LocalFilesEditor/admin.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/LocalFilesEditor/admin.php b/plugins/LocalFilesEditor/admin.php index 2cd5e3afa..348fdd0cc 100644 --- a/plugins/LocalFilesEditor/admin.php +++ b/plugins/LocalFilesEditor/admin.php @@ -93,6 +93,10 @@ if ((isset($_POST['edit'])) and !is_numeric($_POST['file_to_edit'])) if (isset($_POST['create_tpl'])) { $filename = $_POST['tpl_name']; + if (empty($filename)) + { + array_push($page['errors'], l10n('locfiledit_empty_filename')); + } if (get_extension($filename) != 'tpl') { $filename .= '.tpl'; @@ -100,19 +104,20 @@ if (isset($_POST['create_tpl'])) if (!preg_match('/^[a-zA-Z0-9-_.]+$/', $filename)) { array_push($page['errors'], l10n('locfiledit_filename_error')); - $newfile_page = true; } if (is_numeric($_POST['tpl_model']) and $_POST['tpl_model'] != '0') { array_push($page['errors'], l10n('locfiledit_model_error')); - $newfile_page = true; } if (file_exists($_POST['tpl_parent'] . '/' . $filename)) { array_push($page['errors'], l10n('locfiledit_file_already_exists')); + } + if (!empty($page['errors'])) + { $newfile_page = true; } - if (!$newfile_page) + else { $edited_file = $_POST['tpl_parent'] . '/' . $filename; $content_file = ($_POST['tpl_model'] == '0') ? $new_file['tpl'] : file_get_contents($_POST['tpl_model']); |