Skip to content

Commit

Permalink
Prevent script to be called directly
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed May 24, 2018
1 parent aa81840 commit 1f511e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion install/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,14 @@ function update_importDropdown ($table, $name) {
*/
function showContentUpdateForm() {

echo "<form action='update_content.php' method='post'>";
echo "<div class='center'>";
echo "<h3>".__('Update successful, your database is up to date')."</h3>";
echo "<p>".__('You must now proceed to updating your database content')."</p></div>";
echo "<p>";
echo "<a class='vsubmit' href='update_content.php'>".__('Continue?')."</a>";
echo "<input typ='hidden' name='do_continue' value='1'/>";
echo "<input type='submit' class='vsubmit' value='.__('Continue?').'/>";
echo "</form>";
}


Expand Down
4 changes: 4 additions & 0 deletions install/update_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
* ---------------------------------------------------------------------
*/

if (!isset($_POST['do_continue'])) {
die("Sorry. You can't access this file directly");
}

//#################### INCLUDE & SESSIONS ############################
define('GLPI_ROOT', realpath('..'));

Expand Down

0 comments on commit 1f511e5

Please sign in to comment.