fix database_dump regex not working with no password
This commit is contained in:
parent
857f7e4041
commit
5a4b089a61
@ -164,7 +164,7 @@ class AdminPage extends Extension {
|
|||||||
global $page;
|
global $page;
|
||||||
|
|
||||||
$matches = array();
|
$matches = array();
|
||||||
preg_match("#^(?P<proto>\w+)\:(?:user=(?P<user>\w+)(?:;|$)|password=(?P<password>\w+)(?:;|$)|host=(?P<host>[\w\.\-]+)(?:;|$)|dbname=(?P<dbname>[\w_]+)(?:;|$))+#", DATABASE_DSN, $matches);
|
preg_match("#^(?P<proto>\w+)\:(?:user=(?P<user>\w+)(?:;|$)|password=(?P<password>\w*)(?:;|$)|host=(?P<host>[\w\.\-]+)(?:;|$)|dbname=(?P<dbname>[\w_]+)(?:;|$))+#", DATABASE_DSN, $matches);
|
||||||
$software = $matches['proto'];
|
$software = $matches['proto'];
|
||||||
$username = $matches['user'];
|
$username = $matches['user'];
|
||||||
$password = $matches['password'];
|
$password = $matches['password'];
|
||||||
@ -184,6 +184,8 @@ class AdminPage extends Extension {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//FIXME: .SQL dump is empty if cmd doesn't exist
|
||||||
|
|
||||||
$page->set_mode("data");
|
$page->set_mode("data");
|
||||||
$page->set_type("application/x-unknown");
|
$page->set_type("application/x-unknown");
|
||||||
$page->set_filename('shimmie-'.date('Ymd').'.sql');
|
$page->set_filename('shimmie-'.date('Ymd').'.sql');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user