From 5e06dad411d895c6605115bd4ef4c86f3b2a0041 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Sat, 6 Feb 2021 14:13:22 -0500 Subject: Properly render 2+ namespaces functions in build/gen_stub.php Affects ZEND_NS_FE Add test cases of the global function Backported to php 8.0 from GH-6664 --- build/gen_stub.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'build') diff --git a/build/gen_stub.php b/build/gen_stub.php index 6d1ae99ebc..d84851091b 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -793,9 +793,10 @@ class FuncInfo { } if ($namespace) { + // Render A\B as "A\\B" in C strings for namespaces return sprintf( "\tZEND_NS_FE(\"%s\", %s, %s)\n", - $namespace, $declarationName, $this->getArgInfoName()); + addslashes($namespace), $declarationName, $this->getArgInfoName()); } else { return sprintf("\tZEND_FE(%s, %s)\n", $declarationName, $this->getArgInfoName()); } -- cgit v1.2.1