From 8353de00398b13f6c94eeab6e2401d2e590543c6 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 9 May 2021 23:12:07 +0200 Subject: Add some guard to prevent hooking recursion This shouldn't be necessary, but better safe than sorry. --- src/sp_sloppy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/sp_sloppy.c') 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) { void hook_sloppy() { TSRMLS_FETCH(); - if (NULL == orig_zend_compile_file) { + if (NULL == orig_zend_compile_file && zend_compile_file != sp_compile_file) { orig_zend_compile_file = zend_compile_file; zend_compile_file = sp_compile_file; } - if (NULL == orig_zend_compile_string) { + if (NULL == orig_zend_compile_string && + zend_compile_string != sp_compile_string) { orig_zend_compile_string = zend_compile_string; zend_compile_string = sp_compile_string; } -- cgit v1.3