WordPress.org

Ready to get started?Download WordPress

Forums

preg_match ERROR! (3 posts)

  1. Arturol
    Member
    Posted 11 months ago #

    Can anybody help with this?

    Warning: preg_match() [function.preg-match]: No ending delimiter '/' found in /home/o8/public/www/wp-content/plugins/woocommerce-gateway-dibs-form/gateway-dibs.php on line 707

  2. Arturol
    Member
    Posted 11 months ago #

    This is the code in the php file:
    if ( preg_match($_SERVER["REQUEST_URI"], 'woocommerce/dibscancel') !== false) {

    header("HTTP/1.1 200 Ok");

    $callback = new WC_Gateway_Dibs;
    $callback->cancel_order(stripslashes_deep($_REQUEST));
    return;
    }

  3. vtxyzzy
    Member
    Posted 10 months ago #

    In preg_match, the pattern is the first parameter, not the second. The pattern must be enclosed in delimiters. Slashes are the normal delimiter, but since your pattern contains a slash, you could use a hash mark (#).

    I think what you want is this:

    if ( preg_match( '#woocommerce/dibscancel#', $_SERVER["REQUEST_URI"]) !== false) {

Reply

You must log in to post.

About this Topic