From 23ef85fa74c07093a9f7de6879fabebc0aeed18f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 12 Oct 2006 15:20:33 +0000 Subject: some test code, hopefully working for all occassions where we are using the functions... git-svn-id: file:///svn/phpbb/trunk@6487 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/session.php') diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 09a52feb1f..079d7b9f07 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -64,7 +64,8 @@ class session $query_string = trim(implode('&', $args)); // basenamed page name (for example: index.php) - $page_name = htmlspecialchars(basename($script_name)); + $page_name = basename($script_name); + $page_name = urlencode(htmlspecialchars($page_name)); // current directory within the phpBB root (for example: adm) $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($root_path))); @@ -112,6 +113,11 @@ class session 'page' => $page ); + if (!file_exists($page_name)) + { + trigger_error('You are on a page that does not exist!', E_USER_ERROR); + } + return $page_array; } -- cgit v1.2.1