Skip to content

Commit

Permalink
Check if .htaccess is writable on install/update
Browse files Browse the repository at this point in the history
  • Loading branch information
nitriques committed Mar 24, 2016
1 parent 52f3030 commit bfea95b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public function install()
$htaccess = new HTAccess();
try {
if ($htaccess->exists()) {
if (!$htaccess->is_writable()) {
throw new Exception(__('.htaccess exists but is not writable.'));
}
$htaccess->enableExtension();
}
// Create workspace directory
Expand Down Expand Up @@ -93,6 +96,10 @@ public function update($previousVersion = false)
require_once 'lib/class.htaccess.php';
$htaccess = new HTAccess();

if ($htaccess->exists() && !$htaccess->is_writable()) {
throw new Exception(__('.htaccess exists but is not writable.'));
}

if (version_compare($previousVersion, '1.15', '<')) {
// Move /manifest/jit-trusted-sites into /workspace/jit-image-manipulation
if (General::realiseDirectory(WORKSPACE . '/jit-image-manipulation', Symphony::Configuration()->get('write_mode', 'directory')) && file_exists(MANIFEST . '/jit-trusted-sites')) {
Expand Down

0 comments on commit bfea95b

Please sign in to comment.