Skip to content

Commit

Permalink
Update simple.php
Browse files Browse the repository at this point in the history
  • Loading branch information
domOrielton committed Oct 2, 2018
1 parent 9aea906 commit 29d292d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions simple.php
@@ -1,6 +1,7 @@
<?php

// configuration settings, edit settings in config.php as appropriate
// settings include the base url, the notes path and the menu items displayed
include('config.php');

// Disable caching.
Expand All @@ -12,13 +13,11 @@
if (!isset($_GET['note']) || !preg_match('/^([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)$/', $_GET['note'])) {

// Generate a name with 5 random unambiguous characters. Redirect to it.
// Base URL of the website, without trailing slash. This can be hardcoded if PHP_SELF doesn't work for you
$base_url = dirname($_SERVER['PHP_SELF']);
header("Location: $base_url/" . substr(str_shuffle('012345679abcdefghjkmnpqrstwxyz'), -5));
die;
}

$path = '_notes/' . $_GET['note'];
$path = $data_directory . $_GET['note'];

$include_Header = true;
$allow_password = true; // to work with files that already have a password set
Expand Down

0 comments on commit 29d292d

Please sign in to comment.