Re: [PHP-DEV] DOMXPath / XSLTProcessor function callbacks

2023-10-15 Thread Niels Dossche
Hi Marc On 10/15/23 12:53, Marc wrote: > Hi, > > On 14.10.23 13:54, Niels Dossche wrote: >> Hi Tim >> >> On 10/14/23 12:30, Tim Düsterhus wrote: >>> Hi >>> >>> On 10/13/23 00:39, Niels Dossche wrote: Please let me know your thoughts. >>> What does calling ->registerPHPFunctions() do when

Re: [PHP-DEV] DOMXPath / XSLTProcessor function callbacks

2023-10-15 Thread Marc
Hi, On 14.10.23 13:54, Niels Dossche wrote: Hi Tim On 10/14/23 12:30, Tim Düsterhus wrote: Hi On 10/13/23 00:39, Niels Dossche wrote: Please let me know your thoughts. What does calling ->registerPHPFunctions() do when it's called more than once? Will the existing allow-list be

Re: [PHP-DEV] DOMXPath / XSLTProcessor function callbacks

2023-10-14 Thread Niels Dossche
Hi Tim On 10/14/23 14:42, Tim Düsterhus wrote: > Hi > > On 10/14/23 13:54, Niels Dossche wrote: >>> (a) Call ucfirst(), but not strtoupper() >>> (b) Call both >> >> You can call both, it's additive. >> > > Okay, for your suggestion (1) the following would work then? > > // Register all native

Re: [PHP-DEV] DOMXPath / XSLTProcessor function callbacks

2023-10-14 Thread Tim Düsterhus
Hi On 10/14/23 13:54, Niels Dossche wrote: (a) Call ucfirst(), but not strtoupper() (b) Call both You can call both, it's additive. Okay, for your suggestion (1) the following would work then? // Register all native PHP functions. $xpath->registerPHPFunctions(null); // Register

Re: [PHP-DEV] DOMXPath / XSLTProcessor function callbacks

2023-10-14 Thread Niels Dossche
Hi Tim On 10/14/23 12:30, Tim Düsterhus wrote: > Hi > > On 10/13/23 00:39, Niels Dossche wrote: >> Please let me know your thoughts. > > What does calling ->registerPHPFunctions() do when it's called more than > once? Will the existing allow-list be overwritten or amended? > > i.e. > >

Re: [PHP-DEV] DOMXPath / XSLTProcessor function callbacks

2023-10-14 Thread Tim Düsterhus
Hi On 10/13/23 00:39, Niels Dossche wrote: Please let me know your thoughts. What does calling ->registerPHPFunctions() do when it's called more than once? Will the existing allow-list be overwritten or amended? i.e. $xpath->registerPHPFunctions([ 'strtoupper', ]);

[PHP-DEV] DOMXPath / XSLTProcessor function callbacks

2023-10-12 Thread Niels Dossche
Hi internals I'm looking to extend the functionality of calling PHP functions from within the DOMXPath or XSLTProcessor classes. In case you're unfamiliar here's a quick rundown. The DOMXPath class allows you to execute XPath queries on a DOM tree to lookup certain nodes satisfying a filter.