summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--main/main.c4
-rw-r--r--main/php_syslog.c7
-rw-r--r--main/php_syslog.h1
-rw-r--r--php.ini-development1
-rw-r--r--php.ini-production1
6 files changed, 17 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 2fe64f4ad3..ecd81b0c5e 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 7.3.8
+- Core:
+ . Added syslog.filter=raw option. (Erik Lundin)
+
- Opcache:
. Fixed bug #78106 (Path resolution fails if opcache disabled during request).
(Nikita)
diff --git a/main/main.c b/main/main.c
index ee422db52f..98c0a26f43 100644
--- a/main/main.c
+++ b/main/main.c
@@ -346,6 +346,10 @@ static PHP_INI_MH(OnSetLogFilter)
PG(syslog_filter) = PHP_SYSLOG_FILTER_ASCII;
return SUCCESS;
}
+ if (!strcmp(filter, "raw")) {
+ PG(syslog_filter) = PHP_SYSLOG_FILTER_RAW;
+ return SUCCESS;
+ }
return FAILURE;
}
diff --git a/main/php_syslog.c b/main/php_syslog.c
index dd16f05217..561a63cf00 100644
--- a/main/php_syslog.c
+++ b/main/php_syslog.c
@@ -77,6 +77,13 @@ PHPAPI void php_syslog(int priority, const char *format, ...) /* {{{ */
smart_string_0(&fbuf);
va_end(args);
+ if (PG(syslog_filter) == PHP_SYSLOG_FILTER_RAW) {
+ /* Just send it directly to the syslog */
+ syslog(priority, "%.*s", (int)fbuf.len, fbuf.c);
+ smart_string_free(&fbuf);
+ return;
+ }
+
for (ptr = fbuf.c; ; ++ptr) {
c = *ptr;
if (c == '\0') {
diff --git a/main/php_syslog.h b/main/php_syslog.h
index dee0e5aaa3..401f498194 100644
--- a/main/php_syslog.h
+++ b/main/php_syslog.h
@@ -34,6 +34,7 @@
#define PHP_SYSLOG_FILTER_ALL 0
#define PHP_SYSLOG_FILTER_NO_CTRL 1
#define PHP_SYSLOG_FILTER_ASCII 2
+#define PHP_SYSLOG_FILTER_RAW 3
BEGIN_EXTERN_C()
PHPAPI void php_syslog(int, const char *format, ...);
diff --git a/php.ini-development b/php.ini-development
index 320cf170a3..97e1657a7c 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -596,6 +596,7 @@ html_errors = On
; ascii (all printable ASCII characters and NL)
; no-ctrl (all characters except control characters)
; all (all characters)
+; raw (like "all", but messages are not split at newlines)
; http://php.net/syslog.filter
;syslog.filter = ascii
diff --git a/php.ini-production b/php.ini-production
index 656ae67302..a44fe0fa99 100644
--- a/php.ini-production
+++ b/php.ini-production
@@ -603,6 +603,7 @@ html_errors = On
; ascii (all printable ASCII characters and NL)
; no-ctrl (all characters except control characters)
; all (all characters)
+; raw (like "all", but messages are not split at newlines)
; http://php.net/syslog.filter
;syslog.filter = ascii