WordPress.org

Ready to get started?Download WordPress

Forums

WP MySQL Console
ignore ; between quotes (1 post)

  1. antonymken1
    Member
    Posted 1 year ago #

    in this file ajax.php

    on line 10: i have replaced
    $cmdArr = explode(';', $commands); with this
    $cmdArr = quoted_explode($commands, $delimiters = ';');

    you will also need this functions

    function regex_escape($subject) {
    		return str_replace(array('\\', '^', '-', ']'), array('\\\\', '\\^', '\\-', '\\]'), $subject);
    	}
    
    	function quoted_explode($subject, $delimiters = ',', $quotes = '\'') {
    		$clauses[] = '[^'.regex_escape($delimiters.$quotes).']';
    		foreach(str_split($quotes) as $quote) {
    			$quote = regex_escape($quote);
    			$clauses[] = "[$quote][^$quote]*[$quote]";
    		}
    		$regex = '(?:'.implode('|', $clauses).')+';
    		preg_match_all('/'.str_replace('/', '\\/', $regex).'/', $subject, $matches);
    		return $matches[0];
    	}

    http://wordpress.org/extend/plugins/wp-mysql-console/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.