diff --git a/index.php b/index.php
index 09adf81db3fd85e34e0fde999c1daccd025d9b13..b8d25853a43af9565dcadd6732f8e62122591cc2 100644
--- a/index.php
+++ b/index.php
@@ -1,5 +1,5 @@
 <?php
-	$dir = $_GET['dir'] ? $_GET['dir'] : '..';
+	$dir = (isset($_GET['dir']) AND ($_GET['dir'])) ? $_GET['dir'] : '..';
 	chdir($dir);
 	require 'ecrire/inc_version.php';