diff options
author | Andreas Gohr <andi@splitbrain.org> | 2023-08-30 14:48:22 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2023-08-30 14:48:22 +0200 |
commit | b1f206e1d439d693686c99955ab305e7ca94e760 (patch) | |
tree | 67eb5e7400fb7fffd6fd6b5f277b4a5680ca0a11 /index.php | |
parent | bf9be0e3945b81d0a5a9d209dfda78418b12f64b (diff) | |
download | dokuwiki-b1f206e1d439d693686c99955ab305e7ca94e760.tar.gz dokuwiki-b1f206e1d439d693686c99955ab305e7ca94e760.zip |
Apply rector fixes to bin and toplevel
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -13,8 +13,8 @@ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * @author Andreas Gohr <andi@splitbrain.org> */ -if (php_sapi_name() != 'cli-server') { - if (!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__) . '/'); +if (PHP_SAPI != 'cli-server') { + if (!defined('DOKU_INC')) define('DOKU_INC', __DIR__ . '/'); require_once(DOKU_INC . 'inc/init.php'); send_redirect(wl($conf['start'])); @@ -49,7 +49,8 @@ if (preg_match('/^\/_media\/(.*)/', $_SERVER['SCRIPT_NAME'], $m)) { // existing files // access limitiations - if (preg_match('/\/([._]ht|README$|VERSION$|COPYING$)/', $_SERVER['SCRIPT_NAME']) or + if ( + preg_match('/\/([._]ht|README$|VERSION$|COPYING$)/', $_SERVER['SCRIPT_NAME']) || preg_match('/^\/(data|conf|bin|inc)\//', $_SERVER['SCRIPT_NAME']) ) { header('HTTP/1.1 403 Forbidden'); |