Commit 6055a0f3 authored by kcristiano's avatar kcristiano Committed by colemanw

CRM-21166: WP-CLI commands fail due to whitespace in regex Remove whitespace...

CRM-21166: WP-CLI commands fail due to whitespace in regex  Remove whitespace from regex on parseDSN function.
parent 65bb0d5b
......@@ -1136,7 +1136,7 @@ if ( ! defined( 'CIVICRM_WPCLI_LOADED' ) ) {
// Get phptype and dbsyntax
// $str => phptype( dbsyntax )
if ( preg_match( '|^( .+? )\( ( .*? )\ )$|', $str, $arr ) ) {
if ( preg_match( '|^(.+?)\((.*?)\)$|', $str, $arr ) ) {
$parsed['phptype'] = $arr[1];
$parsed['dbsyntax'] = ! $arr[2] ? $arr[1] : $arr[2];
} else {
......@@ -1163,7 +1163,7 @@ if ( ! defined( 'CIVICRM_WPCLI_LOADED' ) ) {
// Find protocol and hostspec
if ( preg_match( '|^( [^( ]+ )\( ( .*? )\ )/?( .*? )$|', $dsn, $match ) ) {
if ( preg_match( '|^([^(]+)\((.*? )\)/?(.*?)$|', $dsn, $match ) ) {
// $dsn => proto( proto_opts )/database
$proto = $match[1];
$proto_opts = $match[2] ? $match[2] : false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment