summaryrefslogtreecommitdiff
path: root/src/sp_sloppy.c
diff options
context:
space:
mode:
authorjvoisin2021-05-09 23:12:07 +0200
committerjvoisin2021-05-09 23:12:07 +0200
commit8353de00398b13f6c94eeab6e2401d2e590543c6 (patch)
treece7b388456098a5df6af5eb16583e8a92e058474 /src/sp_sloppy.c
parentd934db81cdcd64086c8867bb422bfa7e0d18bb38 (diff)
Add some guard to prevent hooking recursion
This shouldn't be necessary, but better safe than sorry.
Diffstat (limited to 'src/sp_sloppy.c')
-rw-r--r--src/sp_sloppy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sp_sloppy.c b/src/sp_sloppy.c
index f9ed718..ff2d644 100644
--- a/src/sp_sloppy.c
+++ b/src/sp_sloppy.c
@@ -99,12 +99,13 @@ PHP_FUNCTION(sp_array_keys) {
99void hook_sloppy() { 99void hook_sloppy() {
100 TSRMLS_FETCH(); 100 TSRMLS_FETCH();
101 101
102 if (NULL == orig_zend_compile_file) { 102 if (NULL == orig_zend_compile_file && zend_compile_file != sp_compile_file) {
103 orig_zend_compile_file = zend_compile_file; 103 orig_zend_compile_file = zend_compile_file;
104 zend_compile_file = sp_compile_file; 104 zend_compile_file = sp_compile_file;
105 } 105 }
106 106
107 if (NULL == orig_zend_compile_string) { 107 if (NULL == orig_zend_compile_string &&
108 zend_compile_string != sp_compile_string) {
108 orig_zend_compile_string = zend_compile_string; 109 orig_zend_compile_string = zend_compile_string;
109 zend_compile_string = sp_compile_string; 110 zend_compile_string = sp_compile_string;
110 } 111 }