diff options
-rw-r--r-- | cache/.htaccess | 2 | ||||
-rw-r--r-- | cache/.placeholder | 0 | ||||
-rw-r--r-- | data/.htaccess | 2 | ||||
-rw-r--r-- | data/.placeholder | 0 | ||||
-rw-r--r-- | index.php | 7 | ||||
-rw-r--r-- | pagecache/.htaccess | 2 | ||||
-rw-r--r-- | pagecache/.placeholder | 0 | ||||
-rw-r--r-- | tmp/.htaccess | 2 | ||||
-rw-r--r-- | tmp/.placeholder | 0 |
9 files changed, 8 insertions, 7 deletions
diff --git a/cache/.htaccess b/cache/.htaccess new file mode 100644 index 00000000..b584d98c --- /dev/null +++ b/cache/.htaccess | |||
@@ -0,0 +1,2 @@ | |||
1 | Allow from none | ||
2 | Deny from all | ||
diff --git a/cache/.placeholder b/cache/.placeholder deleted file mode 100644 index e69de29b..00000000 --- a/cache/.placeholder +++ /dev/null | |||
diff --git a/data/.htaccess b/data/.htaccess new file mode 100644 index 00000000..b584d98c --- /dev/null +++ b/data/.htaccess | |||
@@ -0,0 +1,2 @@ | |||
1 | Allow from none | ||
2 | Deny from all | ||
diff --git a/data/.placeholder b/data/.placeholder deleted file mode 100644 index e69de29b..00000000 --- a/data/.placeholder +++ /dev/null | |||
@@ -88,13 +88,6 @@ header("Pragma: no-cache"); | |||
88 | 88 | ||
89 | // Directories creations (Note that your web host may require differents rights than 705.) | 89 | // Directories creations (Note that your web host may require differents rights than 705.) |
90 | if (!is_writable(realpath(dirname(__FILE__)))) die('<pre>ERROR: Shaarli does not have the right to write in its own directory ('.realpath(dirname(__FILE__)).').</pre>'); | 90 | if (!is_writable(realpath(dirname(__FILE__)))) die('<pre>ERROR: Shaarli does not have the right to write in its own directory ('.realpath(dirname(__FILE__)).').</pre>'); |
91 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['DATADIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. | ||
92 | // Second check to see if Shaarli can write in its directory, because on some hosts is_writable() is not reliable. | ||
93 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) die('<pre>ERROR: Shaarli does not have the right to write in its data directory ('.realpath($GLOBALS['config']['DATADIR']).').</pre>'); | ||
94 | if ($GLOBALS['config']['ENABLE_LOCALCACHE']) | ||
95 | { | ||
96 | if (!is_file($GLOBALS['config']['CACHEDIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['CACHEDIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. | ||
97 | } | ||
98 | 91 | ||
99 | // Handling of old config file which do not have the new parameters. | 92 | // Handling of old config file which do not have the new parameters. |
100 | if (empty($GLOBALS['title'])) $GLOBALS['title']='Shared links on '.htmlspecialchars(indexUrl()); | 93 | if (empty($GLOBALS['title'])) $GLOBALS['title']='Shared links on '.htmlspecialchars(indexUrl()); |
diff --git a/pagecache/.htaccess b/pagecache/.htaccess new file mode 100644 index 00000000..b584d98c --- /dev/null +++ b/pagecache/.htaccess | |||
@@ -0,0 +1,2 @@ | |||
1 | Allow from none | ||
2 | Deny from all | ||
diff --git a/pagecache/.placeholder b/pagecache/.placeholder deleted file mode 100644 index e69de29b..00000000 --- a/pagecache/.placeholder +++ /dev/null | |||
diff --git a/tmp/.htaccess b/tmp/.htaccess new file mode 100644 index 00000000..b584d98c --- /dev/null +++ b/tmp/.htaccess | |||
@@ -0,0 +1,2 @@ | |||
1 | Allow from none | ||
2 | Deny from all | ||
diff --git a/tmp/.placeholder b/tmp/.placeholder deleted file mode 100644 index e69de29b..00000000 --- a/tmp/.placeholder +++ /dev/null | |||