Skip to content

Commit 018955b

Browse files
committed
- Implemented FS#3308 - PATH placeholder in directive snippets (placeholder is named {DOCROOT}, like for nginx).
1 parent f798aa0 commit 018955b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

interface/web/sites/templates/web_domain_advanced.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ <h2><tmpl_var name="list_head_txt"></h2>
8888
</div>
8989
<div class="ctrlHolder apache">
9090
<label for="apache_directives">{tmpl_var name='apache_directives_txt'}</label>
91-
<textarea name="apache_directives" id="apache_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='apache_directives'}</textarea>&nbsp;<b>{tmpl_var name="available_apache_directive_snippets_txt"}</b><br><br>&nbsp;{tmpl_var name="apache_directive_snippets_txt"}
91+
<textarea name="apache_directives" id="apache_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='apache_directives'}</textarea>&nbsp;<b>{tmpl_var name="available_apache_directive_snippets_txt"}</b><br><br>&nbsp;{tmpl_var name="apache_directive_snippets_txt"}<br>----<br><b>&nbsp;{tmpl_var name='variables_txt'}:</b> <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT}</a>
9292
</div>
9393
<div class="ctrlHolder nginx">
9494
<label for="nginx_directives">{tmpl_var name='nginx_directives_txt'}</label>

server/plugins-available/apache2_plugin.inc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,8 @@ function update($event_name, $data) {
892892
// Make sure we only have Unix linebreaks
893893
$vhost_data['apache_directives'] = str_replace("\r\n", "\n", $vhost_data['apache_directives']);
894894
$vhost_data['apache_directives'] = str_replace("\r", "\n", $vhost_data['apache_directives']);
895+
$trans = array('{DOCROOT}' => $vhost_data['web_document_root_www']);
896+
$vhost_data['apache_directives'] = strtr($vhost_data['apache_directives'], $trans);
895897

896898
// Check if a SSL cert exists
897899
$ssl_dir = $data['new']['document_root'].'/ssl';

0 commit comments

Comments
 (0)