<?php
-error_reporting(6135); // errors and warnings
+error_reporting(6133); // errors
include "../adminer/include/coverage.inc.php";
// disable magic quotes to be able to use database escaping function
remove_slashes(array(&$_GET, &$_POST, &$_COOKIE), $filter);
-if (get_magic_quotes_runtime()) {
+if (function_exists("get_magic_quotes_runtime") && get_magic_quotes_runtime()) {
set_magic_quotes_runtime(false);
}
@set_time_limit(0); // @ - can be disabled
* @return null modified in place
*/
function remove_slashes($process, $filter = false) {
- if (get_magic_quotes_gpc()) {
+ if (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) {
while (list($key, $val) = each($process)) {
foreach ($val as $k => $v) {
unset($process[$key][$k]);
<?php
// PDO can be used in several database drivers
if (extension_loaded('pdo')) {
- /*abstract*/ class Min_PDO extends PDO {
- var $_result, $server_info, $affected_rows, $errno, $error;
+ /*abstract*/ class Min_PDO {
+ var $_result, $server_info, $affected_rows, $errno, $error, $pdo;
function __construct() {
global $adminer;
function dsn($dsn, $username, $password, $options = array()) {
try {
- parent::__construct($dsn, $username, $password, $options);
+ $this->pdo = new PDO($dsn, $username, $password, $options);
} catch (Exception $ex) {
auth_error(h($ex->getMessage()));
}
- $this->setAttribute(13, array('Min_PDOStatement')); // 13 - PDO::ATTR_STATEMENT_CLASS
- $this->server_info = @$this->getAttribute(4); // 4 - PDO::ATTR_SERVER_VERSION
+ $this->pdo->setAttribute(13, array('Min_PDOStatement')); // 13 - PDO::ATTR_STATEMENT_CLASS
+ $this->server_info = @$this->pdo->getAttribute(4); // 4 - PDO::ATTR_SERVER_VERSION
}
/*abstract function select_db($database);*/
function query($query, $unbuffered = false) {
- $result = parent::query($query);
+ $result = $this->pdo->query($query);
$this->error = "";
if (!$result) {
- list(, $this->errno, $this->error) = $this->errorInfo();
+ list(, $this->errno, $this->error) = $this->pdo->errorInfo();
if (!$this->error) {
$this->error = lang('Unknown error.');
}
#!/usr/bin/env php
<?php
-error_reporting(6135); // errors and warnings
+error_reporting(6133); // errors
include dirname(__FILE__) . "/adminer/include/version.inc.php";
include dirname(__FILE__) . "/externals/JsShrink/jsShrink.php";
$short_variables[$key] = short_identifier($number, $chars); // could use also numbers and \x7f-\xff
}
- $set = array_flip(preg_split('//', '!"#$%&\'()*+,-./:;<=>?@[\]^`{|}'));
+ $set = array_flip(preg_split('//', '!"#$%&\'()*+,-./:;<=>?@[]^`{|}'));
$space = '';
$output = '';
$in_echo = false;
return '"' . add_quo_slashes($file) . '"';
}
+if (!function_exists("each")) {
+ function each(&$arr) {
+ $key = key($arr);
+ next($arr);
+ return $key === null ? false : array($key, $arr[$key]);
+ }
+}
+
function min_version() {
return true;
}