[Plugin: PDO (SQLite) For WordPress] Broken for PHP 5.1
-
I am using PDO for WordPress with PHP 5.1, which should fall within the requirements. However, the installation process breaks in step 2. This probably produces a clear error, but I don’t have access to PHP logs on my server.
I tracked the bug down to the use of the function preg_last_error() in file wp-content/pdo/driver_sqlite/pdo_sqlite_driver_create.php. This function was introduced in PHP 5.2. I propose the following patch (taken from PDO version 2.7.0):
207,213c207 < if (function_exists('preg_last_error')) { // PHP >= 5.2.0 < $this->_errors[] = preg_last_error(); < } else { < // No way to check for errors in PHP < 5.2 < // Silently ignore errors. < $this->_errors[] = 0; // PREG_NO_ERROR < } --- > $this->_errors[] = preg_last_error(); 287c281 < } --- > } \ No newline at end of file
- The topic ‘[Plugin: PDO (SQLite) For WordPress] Broken for PHP 5.1’ is closed to new replies.