GravityPDF / querypath

A fork of QueryPath: a PHP library for HTML(5)/XML querying (CSS 4 or XPath) and processing (like jQuery) with PHP8.3 support
Other
23 stars 3 forks source link

Wrap global functions in functions_exists check #48

Open jakejackson1 opened 9 months ago

jakejackson1 commented 9 months ago

Guidelines

Description of the bug

To prevent a fatal PHP error occurring, let's wrap the global functions defined in qp_functions.php inside a functions_exists() check.

Ideally, these global functions would be removed, but they will need to be probably deprecated and then removed in a major version..

QueryPath version

latest

PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions)

any

Minimal reproducible PHP+HTML snippet to replicate bug

function qp() { //do something }

require __DIR__ . '/vendor/autoload.php';

qp();