Skip to content

Commit

Permalink
Fix #371: Filebrowser: bad behavior if required fields are empty
Browse files Browse the repository at this point in the history
As quick-fix we add an `required` attribute to the required input
elements, which should serve our purposes quite well.
  • Loading branch information
cmb69 committed Oct 30, 2018
1 parent 4964a9f commit 2902a2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/filebrowser/tpl/cmsbrowser.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div style="padding: 3em;">

<form method="POST" action="<?php echo $sn, '?', XH_hsc($_SERVER['QUERY_STRING']);?>">
<input type="text" name="createFolder" size="30">
<input type="text" name="createFolder" size="30" required>
<input type="submit" class="submit" value="<?php echo $this->translate('create_folder')?>">
<?php echo $_XH_csrfProtection->tokenInput()?>
</form>
Expand All @@ -49,7 +49,7 @@
<div style="padding: 3em;">

<form method="POST" class="filebrowser_upload" action="<?php echo $sn, '?', XH_hsc($_SERVER['QUERY_STRING']);?>" enctype="multipart/form-data">
<input type="file" name="fbupload">
<input type="file" name="fbupload" required>
<input type="hidden" name="upload" value="upload">
<input type="submit" class="submit" value="<?php echo $this->translate('upload_file')?>">
<?php echo $_XH_csrfProtection->tokenInput()?>
Expand Down
4 changes: 2 additions & 2 deletions plugins/filebrowser/tpl/editorbrowser.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div style="padding: 3em;">

<form method="post" class="filebrowser_upload" enctype="multipart/form-data">
<input type="file" name="fbupload">
<input type="file" name="fbupload" required>
<input type="hidden" name="upload" value="upload">
<?php echo $_XH_csrfProtection->tokenInput()?>
<input type="submit" class="submit" value="<?php echo $this->translate('upload_file')?>">
Expand All @@ -35,7 +35,7 @@
<div style="padding: 3em;">

<form method="post">
<input type="text" name="createFolder" size="30">
<input type="text" name="createFolder" size="30" required>
<?php echo $_XH_csrfProtection->tokenInput()?>
<input type="submit" class="submit" value="<?php echo $this->translate('create_folder')?>">
</form>
Expand Down

0 comments on commit 2902a2f

Please sign in to comment.