From 3a93952c4c9ccead0859eaf77d5b3fed9e5aed2f Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Tue, 29 Sep 2020 10:02:30 +0200
Subject: [PATCH] Move custom php in front of snippet data

---
 server/plugins-available/apache2_plugin.inc.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index bef49172cd..1dd51a6c53 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -1256,6 +1256,8 @@ class apache2_plugin {
 
 			$php_ini_content = $this->get_master_php_ini_content($data['new']);
 
+			$php_ini_content .= "\n".str_replace("\r", '', trim($data['new']['custom_php_ini']));
+
 			if(intval($data['new']['directive_snippets_id']) > 0){
 				$snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'apache' AND active = 'y' AND customer_viewable = 'y'", intval($data['new']['directive_snippets_id']));
 				if(isset($snippet['required_php_snippets']) && trim($snippet['required_php_snippets']) != ''){
@@ -1275,7 +1277,6 @@ class apache2_plugin {
 					}
 				}
 			}
-			$php_ini_content .= "\n".str_replace("\r", '', trim($data['new']['custom_php_ini']));
 
 			$custom_sendmail_path = false;
 			$line = strtok($php_ini_content, '\n');
-- 
GitLab