Skip to content

Commit 803a982

Browse files
author
capkokoon
committed
Restore .htaccess feature
1 parent a5c5866 commit 803a982

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ include/config.php
33
.idea/
44
nbproject/
55
lang/French
6+
.htaccess

.htaccess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
RewriteEngine On
22
RewriteCond %{REQUEST_FILENAME} !-f
3-
RewriteRule ^ index.php [QSA,L]
3+
RewriteRule ^ index.php [QSA,L]

.htaccess.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
RewriteEngine On
2+
RewriteCond %{REQUEST_FILENAME} !-f
3+
RewriteRule ^ index.php [QSA,L]

controller/install.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ public function create_db(array $data)
195195
// Store config in DB
196196
$this->model->save_config($this->load_default_config($data));
197197

198+
// Handle .htaccess
199+
if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules())) {
200+
$this->write_htaccess();
201+
}
202+
198203
// Redirect to homepage
199204
redirect(get_link('/'));
200205
}
@@ -204,6 +209,12 @@ public function write_config($json)
204209
return file_put_contents($this->feather->forum_env['FEATHER_ROOT'].$this->config_file, $json);
205210
}
206211

212+
public function write_htaccess()
213+
{
214+
$data = file_get_contents($this->feather->forum_env['FEATHER_ROOT'].'.htaccess.dist');
215+
return file_put_contents($this->feather->forum_env['FEATHER_ROOT'].'.htaccess', $data);
216+
}
217+
207218
public function load_default_config(array $data)
208219
{
209220
return array(

style/FeatherBB/view/header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function process_form(the_form)
102102
<a href="<?php echo get_base_url() ?>" title="" class="site-name">
103103
<p><?php echo feather_escape($feather_config['o_board_title']) ?></p>
104104
</a>
105-
<div id="brddesc"><?php echo $feather_config['o_board_desc'] ?></div>
105+
<div id="brddesc"><?php echo htmlspecialchars_decode($feather_config['o_board_desc']) ?></div>
106106
</h1>
107107
<div class="status-avatar">
108108
<?php echo $page_info ?>

0 commit comments

Comments
 (0)