Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Create sandboxed webroot
This creates a www webroot directory that can be used as the root for
webserver configuration. The benefit to this approach is that files in
the main directory are no longer exposed on the website. This includes
the data directory, the PHP source code (beyond the required index.php
entry point) and any other files that get placed in the root of the
project during deployment or while running.
  • Loading branch information
adamnfish-gu committed Nov 27, 2015
commit 945b94522266b81008f334f3c2b65a19a67ecbbd
4 changes: 2 additions & 2 deletions lib/rain.tpl.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ class RainTPL{
*
* @var string
*/
static $tpl_dir = "tpl/";
static $tpl_dir = "../tpl/";


/**
* Cache directory. Is the directory where RainTPL will compile the template and save the cache
*
* @var string
*/
static $cache_dir = "tmp/";
static $cache_dir = "../tmp/";


/**
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
8 changes: 4 additions & 4 deletions index.php → www/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
$VERSION='Alpha 0.19';
if (version_compare(PHP_VERSION, '5.2.6') < 0) die('ZeroBin requires php 5.2.6 or above to work. Sorry.');
require_once "lib/serversalt.php";
require_once "lib/vizhash_gd_zero.php";
require_once "../lib/serversalt.php";
require_once "../lib/vizhash_gd_zero.php";

// In case stupid admin has left magic_quotes enabled in php.ini:
if (get_magic_quotes_gpc())
Expand Down Expand Up @@ -62,7 +62,7 @@ function slow_equals($a, $b)
*/
function dataid2path($dataid)
{
return 'data/'.substr($dataid,0,2).'/'.substr($dataid,2,2).'/';
return '../data/'.substr($dataid,0,2).'/'.substr($dataid,2,2).'/';
}

/* Convert paste id to discussion storage path.
Expand Down Expand Up @@ -418,7 +418,7 @@ function processPasteFetch($pasteid)
list ($CIPHERDATA, $ERRORMESSAGE, $STATUS) = processPasteFetch($_SERVER['QUERY_STRING']);
}

require_once "lib/rain.tpl.class.php";
require_once "../lib/rain.tpl.class.php";
header('Content-Type: text/html; charset=utf-8');
$page = new RainTPL;
$page->assign('CIPHERDATA',htmlspecialchars($CIPHERDATA,ENT_NOQUOTES)); // We escape it here because ENT_NOQUOTES can't be used in RainTPL templates.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.