fix usage of extensions from limit_extensions list in apache-cron
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -350,8 +350,15 @@ class apache extends HttpConfigBase
|
|||||||
}
|
}
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . $phpconfig['fpm_settings']['idle_timeout'] . $addheader . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . $phpconfig['fpm_settings']['idle_timeout'] . $addheader . "\n";
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= ' <Directory "' . $mypath . '">' . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= ' <Directory "' . $mypath . '">' . "\n";
|
||||||
$file_extensions = explode(' ', $phpconfig['file_extensions']);
|
$filesmatch = $phpconfig['fpm_settings']['limit_extensions'];
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= ' <FilesMatch "\.(' . implode('|', $file_extensions) . ')$">' . "\n";
|
$extensions = explode(" ", $filesmatch);
|
||||||
|
$filesmatch = "";
|
||||||
|
foreach ($extensions as $ext) {
|
||||||
|
$filesmatch .= substr($ext, 1).'|';
|
||||||
|
}
|
||||||
|
// start block, cut off last pipe and close block
|
||||||
|
$filesmatch = '('.str_replace(".", "\.", substr($filesmatch, 0, -1)).')';
|
||||||
|
$this->virtualhosts_data[$vhosts_filename] .= ' <FilesMatch \.'.$filesmatch.'$>'. "\n";
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= ' AddHandler php5-fastcgi .php' . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= ' AddHandler php5-fastcgi .php' . "\n";
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= ' Action php5-fastcgi /fastcgiphp' . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= ' Action php5-fastcgi /fastcgiphp' . "\n";
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= ' Options +ExecCGI' . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= ' Options +ExecCGI' . "\n";
|
||||||
|
|||||||
@@ -82,7 +82,15 @@ class apache_fcgid extends apache
|
|||||||
}
|
}
|
||||||
$php_options_text.= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . $phpconfig['fpm_settings']['idle_timeout'] . $addheader . "\n";
|
$php_options_text.= ' FastCgiExternalServer ' . $php->getInterface()->getAliasConfigDir() . $srvName . ' -socket ' . $php->getInterface()->getSocketFile() . ' -idle-timeout ' . $phpconfig['fpm_settings']['idle_timeout'] . $addheader . "\n";
|
||||||
$php_options_text.= ' <Directory "' . makeCorrectDir($domain['documentroot']) . '">' . "\n";
|
$php_options_text.= ' <Directory "' . makeCorrectDir($domain['documentroot']) . '">' . "\n";
|
||||||
$php_options_text.= ' <FilesMatch "\.php$">' . "\n";
|
$filesmatch = $phpconfig['fpm_settings']['limit_extensions'];
|
||||||
|
$extensions = explode(" ", $filesmatch);
|
||||||
|
$filesmatch = "";
|
||||||
|
foreach ($extensions as $ext) {
|
||||||
|
$filesmatch .= substr($ext, 1).'|';
|
||||||
|
}
|
||||||
|
// start block, cut off last pipe and close block
|
||||||
|
$filesmatch = '('.str_replace(".", "\.", substr($filesmatch, 0, -1)).')';
|
||||||
|
$php_options_text.= ' <FilesMatch \.'.$filesmatch.'$>'. "\n";
|
||||||
$php_options_text.= ' SetHandler php5-fastcgi'. "\n";
|
$php_options_text.= ' SetHandler php5-fastcgi'. "\n";
|
||||||
$php_options_text.= ' Action php5-fastcgi /fastcgiphp' . "\n";
|
$php_options_text.= ' Action php5-fastcgi /fastcgiphp' . "\n";
|
||||||
$php_options_text.= ' Options +ExecCGI' . "\n";
|
$php_options_text.= ' Options +ExecCGI' . "\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user