wordpress/wp-content/plugins/sqlite-integration/pdoengine.class.php
/**
	 * Method to help rewriting multiple row values insert query.
	 *
	 * It splits the values clause into an array to execute separately.
	 *
	 * @param string $values
	 * @return array
	 */
Method to help rewriting multiple row values insert query.
It splits the values clause into an array to execute separately.

@param string $values
@return array
Method to help rewriting multiple row values insert query . It splits the values clause into an array to execute separately . @param string $values @return array
private function parse_multiple_inserts($values) {
		$tokens = preg_split("/(''|(?<!\\\\)'|(?<!\()\),(?=\s*\())/s", $values, -1, PREG_SPLIT_DELIM_CAPTURE);
		$exploded_parts = array();
		$part = '';
		$literal = false;
		foreach ($tokens as $token) {
			switch ($token) {
				case "),":
					if (!$literal) {
						$exploded_parts[] = $part;
						$part = '';
					} else {
						$part .= $token;
					}
					break;
				case "'":
					if ($literal) {
						$literal = false;
					} else {
						$literal = true;
					}
					$part .= $token;
					break;
				default:
					$part .= $token;
					break;
			}
		}
		if (!empty($part)) {
			$exploded_parts[] = $part;
		}
		return $exploded_parts;
	}
private function parse_multiple_inserts ( $ values ) { $ tokens = preg_split ( " /(''|(?<! \\ \\ )'|(?<!\()\),(?=\s*\())/s " , $ values , - 1 , PREG_SPLIT_DELIM_CAPTURE ) ; $ exploded_parts = array ( ) ; $ part = '' ; $ literal = false ; foreach ( $ tokens as $ token ) { switch ( $ token ) { case " ), " : if ( ! $ literal ) { $ exploded_parts [ ] = $ part ; $ part = '' ; } else { $ part .= $ token ; } break ; case " ' " : if ( $ literal ) { $ literal = false ; } else { $ literal = true ; } $ part .= $ token ; break ; default : $ part .= $ token ; break ; } } if ( ! empty ( $ part ) ) { $ exploded_parts [ ] = $ part ; } return $ exploded_parts ; }
Method to help rewriting multiple row values insert query.
Method to help rewriting multiple row values insert query .