mirror of
https://github.com/vrana/adminer.git
synced 2025-08-10 08:34:20 +02:00
Replace ereg*() by preg_*()
ereg() triggers deprecated error which is sent to custom error handlers. It is also faster. There are no more deprecated functions except mysql_connect().
This commit is contained in:
@@ -10,14 +10,14 @@
|
||||
class AdminerDumpZip {
|
||||
/** @access protected */
|
||||
var $filename, $data;
|
||||
|
||||
|
||||
function dumpOutput() {
|
||||
if (!class_exists('ZipArchive')) {
|
||||
return array();
|
||||
}
|
||||
return array('zip' => 'ZIP');
|
||||
}
|
||||
|
||||
|
||||
function _zip($string, $state) {
|
||||
// ZIP can be created without temporary file by gzcompress - see PEAR File_Archive
|
||||
$this->data .= $string;
|
||||
@@ -33,10 +33,10 @@ class AdminerDumpZip {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
function dumpHeaders($identifier, $multi_table = false) {
|
||||
if ($_POST["output"] == "zip") {
|
||||
$this->filename = "$identifier." . ($multi_table && ereg("[ct]sv", $_POST["format"]) ? "tar" : $_POST["format"]);
|
||||
$this->filename = "$identifier." . ($multi_table && preg_match("~[ct]sv~", $_POST["format"]) ? "tar" : $_POST["format"]);
|
||||
header("Content-Type: application/zip");
|
||||
ob_start(array($this, '_zip'));
|
||||
}
|
||||
|
Reference in New Issue
Block a user