Skip to content

wp_die() not exclusively an early terminating function #200

@IanDelMar

Description

@IanDelMar

wp_die() is treated as if it terminated script execution early:

earlyTerminatingFunctionCalls:
- wp_die

But for wp_die('', '', ['exit' => false]) the script execution will not be terminated in any of WP's wp_die handlers.

if (somethingIsTrue()) {
	$foo = true;
} elseif (orSomethingElseIsTrue()) {
	$foo = false;
} else {
	wp_die('', '', ['exit' => false])
}

doFoo($foo); // won't catch possibly undefined variable $foo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions