WordPress.org

Support

Support » How-To and Troubleshooting » preg_match ERROR!

preg_match ERROR!

  • 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

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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;
    }

    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) {
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘preg_match ERROR!’ is closed to new replies.
Skip to toolbar