Commit c83ce3f6 authored by Florian Schaal's avatar Florian Schaal

add {WEBROOT} to php-directive-snippets

parent a616a496
......@@ -19,7 +19,8 @@
<label for="snippet" class="col-sm-3 control-label">{tmpl_var name='snippet_txt'}</label>
<tmpl_if name='is_master'><div class="col-sm-9 col-text"><pre>{tmpl_var name='snippet'}</pre></div></tmpl_else><div class="col-sm-9"><textarea class="form-control" name="snippet" id="snippet" rows='10' cols='50'>{tmpl_var name='snippet'}</textarea>
&nbsp; Nginx {tmpl_var name='variables_txt'}: <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT}</a>, <a href="javascript:void(0);" class="addPlaceholder">{FASTCGIPASS}</a>, <a href="javascript:void(0);" class="addPlaceholder">{PHPFALLBACKFASTCGIPASS}</a><br />
&nbsp; Apache {tmpl_var name='variables_txt'}: <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT}</a>, <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT_CLIENT}</a>
&nbsp; Apache {tmpl_var name='variables_txt'}: <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT}</a>, <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT_CLIENT}</a> <br />
&nbsp; PHP {tmpl_var name='variables_txt'}: <a href="javascript:void(0);" class="addPlaceholder">{WEBROOT}</a>
</div></tmpl_if>
</div>
<tmpl_if name='is_master'></tmpl_else>
......@@ -81,4 +82,4 @@
}
});
</script>
\ No newline at end of file
</script>
......@@ -1310,7 +1310,7 @@ class page_action extends tform_actions {
// value inside ''
if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*\'.*\'\s*;*\s*$@', $custom_php_ini_settings_line)) continue;
// everything else
if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*[-a-zA-Z0-9~&=_\@/,.#\s\|]*\s*;*\s*$@', $custom_php_ini_settings_line)) continue;
if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*[-a-zA-Z0-9~&=_\@/,.#\{\}\s\|]*\s*;*\s*$@', $custom_php_ini_settings_line)) continue;
$custom_php_ini_settings_are_valid = false;
break;
}
......
......@@ -3149,6 +3149,7 @@ class apache2_plugin {
$custom_php_ini_settings = str_replace("\r", "\n", $custom_php_ini_settings);
$ini_settings = explode("\n", $custom_php_ini_settings);
if(is_array($ini_settings) && !empty($ini_settings)){
$ini_settings = str_replace('{DOCROOT}', $data['new']['document_root'], $ini_settings);
foreach($ini_settings as $ini_setting){
$ini_setting = trim($ini_setting);
if(substr($ini_setting, 0, 1) == ';') continue;
......
......@@ -2778,6 +2778,7 @@ class nginx_plugin {
$custom_php_ini_settings = str_replace("\r", "\n", $custom_php_ini_settings);
$ini_settings = explode("\n", $custom_php_ini_settings);
if(is_array($ini_settings) && !empty($ini_settings)){
$ini_settings = str_replace('{WEBROOT}', $data['new']['document_root'].'/web', $ini_settings);
foreach($ini_settings as $ini_setting){
$ini_setting = trim($ini_setting);
if(substr($ini_setting, 0, 1) == ';') continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment