summaryrefslogtreecommitdiff
path: root/src/php_snuffleupagus.h
diff options
context:
space:
mode:
authorBen Fuhrmannek2021-02-16 11:16:59 +0100
committerBen Fuhrmannek2021-02-16 11:16:59 +0100
commit5484bcb5eb2714e7438927e2566c86a74d7c51af (patch)
treeb78326d2999397be4c08e06b23209981f82a4ea9 /src/php_snuffleupagus.h
parent7ac1e3866ef4f146c6c93a5ca13b9aebb14e936a (diff)
parentcecfdd808da67be908dbe7144cc8c74dfb3f855e (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/php_snuffleupagus.h')
-rw-r--r--src/php_snuffleupagus.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/php_snuffleupagus.h b/src/php_snuffleupagus.h
index 5919126..248045c 100644
--- a/src/php_snuffleupagus.h
+++ b/src/php_snuffleupagus.h
@@ -1,9 +1,9 @@
1#ifndef PHP_SNUFFLEUPAGUS_H 1#ifndef PHP_SNUFFLEUPAGUS_H
2#define PHP_SNUFFLEUPAGUS_H 2#define PHP_SNUFFLEUPAGUS_H
3 3
4#define PHP_SNUFFLEUPAGUS_VERSION "0.5.0" 4#define PHP_SNUFFLEUPAGUS_VERSION "0.7.0"
5#define PHP_SNUFFLEUPAGUS_EXTNAME "snuffleupagus" 5#define PHP_SNUFFLEUPAGUS_EXTNAME "snuffleupagus"
6#define PHP_SNUFFLEUPAGUS_AUTHOR "NBS System" 6#define PHP_SNUFFLEUPAGUS_AUTHOR "NBS System & Julien (jvoisin) Voisin"
7#define PHP_SNUFFLEUPAGUS_URL "https://github.com/jvoisin/snuffleupagus" 7#define PHP_SNUFFLEUPAGUS_URL "https://github.com/jvoisin/snuffleupagus"
8#define PHP_SNUFFLEUPAGUS_COPYRIGHT "LGPLv2" 8#define PHP_SNUFFLEUPAGUS_COPYRIGHT "LGPLv2"
9 9
@@ -14,7 +14,6 @@
14#include <errno.h> 14#include <errno.h>
15#include <fcntl.h> 15#include <fcntl.h>
16#include <inttypes.h> 16#include <inttypes.h>
17#include <pcre.h>
18#include <stdbool.h> 17#include <stdbool.h>
19#include <stdio.h> 18#include <stdio.h>
20#include <stdlib.h> 19#include <stdlib.h>
@@ -29,12 +28,11 @@
29#include <sys/syslog.h> 28#include <sys/syslog.h>
30 29
31#include "SAPI.h" 30#include "SAPI.h"
32#include "ext/session/php_session.h" 31#include "ext/pcre/php_pcre.h"
33#include "ext/standard/head.h" 32#include "ext/standard/head.h"
34#include "ext/standard/info.h" 33#include "ext/standard/info.h"
35#include "ext/standard/url.h" 34#include "ext/standard/url.h"
36#include "ext/standard/php_var.h" 35#include "ext/standard/php_var.h"
37#include "ext/pcre/php_pcre.h"
38#include "ext/session/php_session.h" 36#include "ext/session/php_session.h"
39#include "php.h" 37#include "php.h"
40#include "php_ini.h" 38#include "php_ini.h"
@@ -47,9 +45,6 @@
47#include "zend_vm.h" 45#include "zend_vm.h"
48 46
49/* Compatibility */ 47/* Compatibility */
50#if ( !HAVE_PCRE && !HAVE_BUNDLED_PCRE )
51#error Snuffleupagus requires PHP7+ with PCRE support
52#endif
53#if PHP_VERSION_ID < 70000 48#if PHP_VERSION_ID < 70000
54#error Snuffleupagus only works with PHP7+. You shouldn't use PHP5 anyway, \ 49#error Snuffleupagus only works with PHP7+. You shouldn't use PHP5 anyway, \
55 since it's not supported anymore: https://secure.php.net/supported-versions.php 50 since it's not supported anymore: https://secure.php.net/supported-versions.php
@@ -60,7 +55,15 @@ typedef void (*zif_handler)(INTERNAL_FUNCTION_PARAMETERS);
60#if PHP_VERSION_ID >= 80000 55#if PHP_VERSION_ID >= 80000
61#define TSRMLS_FETCH() 56#define TSRMLS_FETCH()
62#define TSRMLS_C 57#define TSRMLS_C
58#else
59#if ( !HAVE_PCRE && !HAVE_BUNDLED_PCRE )
60#error Snuffleupagus requires PHP7+ with PCRE support
63#endif 61#endif
62#endif
63
64#define SP_CONFIG_VALID 1
65#define SP_CONFIG_INVALID 0
66#define SP_CONFIG_NONE -1
64 67
65#include "sp_pcre_compat.h" 68#include "sp_pcre_compat.h"
66#include "sp_list.h" 69#include "sp_list.h"
@@ -101,7 +104,7 @@ extern zend_module_entry snuffleupagus_module_entry;
101ZEND_BEGIN_MODULE_GLOBALS(snuffleupagus) 104ZEND_BEGIN_MODULE_GLOBALS(snuffleupagus)
102size_t in_eval; 105size_t in_eval;
103sp_config config; 106sp_config config;
104bool is_config_valid; 107int is_config_valid; // 1 = valid, 0 = invalid, -1 = none
105bool allow_broken_configuration; 108bool allow_broken_configuration;
106HashTable *disabled_functions_hook; 109HashTable *disabled_functions_hook;
107HashTable *sp_internal_functions_hook; 110HashTable *sp_internal_functions_hook;