diff options
author | Felipe Figueroa <amenadiel@gmail.com> | 2020-12-30 13:41:16 +0300 |
---|---|---|
committer | Felipe Figueroa <amenadiel@gmail.com> | 2020-12-30 13:41:16 +0300 |
commit | ea31a8ebb25ab73eebf44fe308ecf73b5e17bd68 (patch) | |
tree | 4292c776591eb19c43e7e8cb580ee5380205b00f | |
parent | 0c036bcc58280ae919fa40e3e389fba1888618f8 (diff) | |
parent | d487992265ca83348fa361015a06399a9fbd798d (diff) |
merge with develop
-rw-r--r-- | assets/sw.js | 7 | ||||
-rw-r--r-- | composer.lock | 2 | ||||
-rw-r--r-- | src/controllers/AlldbController.php | 8 | ||||
-rw-r--r-- | src/controllers/SequencesController.php | 11 | ||||
-rw-r--r-- | src/controllers/TablesController.php | 30 | ||||
-rw-r--r-- | src/database/databasetraits/TableTrait.php | 8 | ||||
-rw-r--r-- | src/lib.inc.php | 8 | ||||
-rw-r--r-- | src/router.php | 8 |
8 files changed, 47 insertions, 35 deletions
diff --git a/assets/sw.js b/assets/sw.js index cdd4e9b5..296dcc71 100644 --- a/assets/sw.js +++ b/assets/sw.js @@ -19,7 +19,6 @@ if (typeof workbox === 'undefined') { } self.__precacheManifest = [].concat(self.__precacheManifest || []); if (typeof workbox !== 'undefined' && workbox) { - workbox.core.skipWaiting(); workbox.core.clientsClaim(); @@ -619,7 +618,7 @@ if (typeof workbox !== 'undefined' && workbox) { }, { "url": "sw.dev.js", - "revision": "5dea6508fde6f65581a3f467e457d123" + "revision": "febc92b3cdfdc35035a05df733c1dd98" }, { "url": "themes/bootstrap/global.css", @@ -1313,8 +1312,8 @@ if (typeof workbox !== 'undefined' && workbox) { cacheName: 'image-files', plugins: [ new workbox.cacheableResponse.CacheableResponse({ statuses: [0, 200] }), - - }) + ], + }) ); // Cache the Google Fonts stylesheets with a stale-while-revalidate strategy. diff --git a/composer.lock b/composer.lock index 8c697870..ffeee5c4 100644 --- a/composer.lock +++ b/composer.lock @@ -6708,7 +6708,7 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": [], - "prefer-stable": false, + "prefer-stable": true, "prefer-lowest": false, "platform": { "php": ">=7.2", diff --git a/src/controllers/AlldbController.php b/src/controllers/AlldbController.php index 1118ae53..c0cc8671 100644 --- a/src/controllers/AlldbController.php +++ b/src/controllers/AlldbController.php @@ -536,16 +536,16 @@ class AlldbController extends BaseController $data = $this->misc->getDatabaseAccessor(); // Default tablespace to null if it isn't set - $this->coalesceArr($_POST, 'formSpc', null); + $this->coalesceArr($_POST, 'formSpc', ''); // Default comment to blank if it isn't set - $this->coalesceArr($_POST, 'formComment', null); + $this->coalesceArr($_POST, 'formComment', ''); // Default collate to blank if it isn't set - $this->coalesceArr($_POST, 'formCollate', null); + $this->coalesceArr($_POST, 'formCollate', ''); // Default ctype to blank if it isn't set - $this->coalesceArr($_POST, 'formCType', null); + $this->coalesceArr($_POST, 'formCType', ''); // Check that they've given a name and a definition if ('' === $_POST['formName']) { diff --git a/src/controllers/SequencesController.php b/src/controllers/SequencesController.php index b7848092..9512e7e1 100644 --- a/src/controllers/SequencesController.php +++ b/src/controllers/SequencesController.php @@ -214,19 +214,12 @@ class SequencesController extends BaseController $sequences = $data->getSequences(); $reqvars = $this->misc->getRequestVars('sequence'); - $actionURL = Decorator::actionurl( - 'sequences', - $reqvars, - [ - 'action' => 'properties', - 'sequence' => Decorator::field('seqname'), - ] - ); $attrs = [ 'text' => Decorator::field('seqname'), 'icon' => 'Sequence', 'toolTip' => Decorator::field('seqcomment'), - 'action' => $actionURL, + 'iconAction' => Decorator::url('sequences', $reqvars, ['action' => 'properties', 'sequence' => Decorator::field('seqname')]), + 'action' => Decorator::url('sequences', $reqvars, ['action' => 'properties', 'sequence' => Decorator::field('seqname')]), ]; return $this->printTree($sequences, $attrs, 'sequences'); diff --git a/src/controllers/TablesController.php b/src/controllers/TablesController.php index a665cdd0..ec774f14 100644 --- a/src/controllers/TablesController.php +++ b/src/controllers/TablesController.php @@ -171,14 +171,34 @@ class TablesController extends BaseController ]; $navlinks = [ 'create' => [ - 'attr' => $attr, + 'attr' => [ + 'href' => [ + 'url' => 'tables', + 'urlvars' => [ + 'action' => 'create', + 'server' => $this->getRequestParam('server'), + 'database' => $this->getRequestParam('database'), + 'schema' => $this->getRequestParam('schema'), + ], + ], + ], 'content' => $this->lang['strcreatetable'], ], ]; if ((0 < $tables->recordCount()) && $data->hasCreateTableLike()) { $navlinks['createlike'] = [ - 'attr' => $attr, + 'attr' => [ + 'href' => [ + 'url' => 'tables', + 'urlvars' => [ + 'action' => 'createlike', + 'server' => $this->getRequestParam('server'), + 'database' => $this->getRequestParam('database'), + 'schema' => $this->getRequestParam('schema'), + ], + ], + ], 'content' => $this->lang['strcreatetablelike'], ]; } @@ -343,7 +363,7 @@ class TablesController extends BaseController break; case 2: // Check inputs - $fields = \trim($_REQUEST['fields']); + $fields = (int) (\trim($_REQUEST['fields'])); if ('' === \trim($_REQUEST['name'])) { $_REQUEST['stage'] = 1; @@ -489,7 +509,7 @@ class TablesController extends BaseController $this->coalesceArr($_REQUEST, 'spcname', null); // Check inputs - $fields = \trim($_REQUEST['fields']); + $fields = (int) (\trim($_REQUEST['fields'])); if ('' === \trim($_REQUEST['name'])) { $_REQUEST['stage'] = 1; @@ -971,7 +991,7 @@ class TablesController extends BaseController $_POST['fields'] = \unserialize(\htmlspecialchars_decode($_POST['fields'], \ENT_QUOTES)); - if ($_SESSION['counter']++ === $_POST['protection_counter']) { + if ($_SESSION['counter']++ === (int) ($_POST['protection_counter'])) { $status = $data->insertRow($_POST['table'], $_POST['fields'], $_POST['values'], $_POST['nulls'], $_POST['format'], $_POST['types']); if (0 === $status) { diff --git a/src/database/databasetraits/TableTrait.php b/src/database/databasetraits/TableTrait.php index 8b1e800f..386fce33 100644 --- a/src/database/databasetraits/TableTrait.php +++ b/src/database/databasetraits/TableTrait.php @@ -593,7 +593,7 @@ trait TableTrait } else { $first = false; } - + $length[$i]=$length[$i] ?? ''; switch ($type[$i]) { // Have to account for weird placing of length for with/without // time zone types @@ -602,7 +602,7 @@ trait TableTrait $qual = \mb_substr($type[$i], 9); $sql .= "\"{$field[$i]}\" timestamp"; - if ('' !== $length[$i]) { + if ('' !== $length[$i] ) { $sql .= "({$length[$i]})"; } @@ -623,9 +623,9 @@ trait TableTrait break; default: - $sql .= "\"{$field[$i]}\" {$type[$i]}"; + $sql .= "\"{$field[$i]}\" {$type[$i]}"; - if ('' !== $length[$i]) { + if ('' !== $length[$i] ) { $sql .= "({$length[$i]})"; } } diff --git a/src/lib.inc.php b/src/lib.inc.php index 4771ac67..65be07a9 100644 --- a/src/lib.inc.php +++ b/src/lib.inc.php @@ -4,14 +4,6 @@ * PHPPgAdmin 6.1.3 */ -\defined('BASE_PATH') || \define('BASE_PATH', \dirname(__DIR__)); - -\defined('THEME_PATH') || \define('THEME_PATH', \dirname(__DIR__) . '/assets/themes'); -// Enforce PHP environment -\ini_set('arg_separator.output', '&'); -\defined('ADODB_ERROR_HANDLER_TYPE') || \define('ADODB_ERROR_HANDLER_TYPE', \E_USER_ERROR); -\defined('ADODB_ERROR_HANDLER') || \define('ADODB_ERROR_HANDLER', '\PHPPgAdmin\ADOdbException::adodb_throw'); - function getAppInstance(): \Slim\App { $subfolder = ''; diff --git a/src/router.php b/src/router.php index b4711b7d..7f965c38 100644 --- a/src/router.php +++ b/src/router.php @@ -12,6 +12,14 @@ foreach (['logs', 'sessions', 'twigcache'] as $tempFolder) { require_once \dirname(__DIR__) . '/vendor/autoload.php'; +\defined('BASE_PATH') || \define('BASE_PATH', \dirname(__DIR__)); + +\defined('THEME_PATH') || \define('THEME_PATH', \dirname(__DIR__) . '/assets/themes'); +// Enforce PHP environment +\ini_set('arg_separator.output', '&'); +\defined('ADODB_ERROR_HANDLER_TYPE') || \define('ADODB_ERROR_HANDLER_TYPE', \E_USER_ERROR); +\defined('ADODB_ERROR_HANDLER') || \define('ADODB_ERROR_HANDLER', '\PHPPgAdmin\ADOdbException::adodb_throw'); + $shouldSetSession = (\defined('PHP_SESSION_ACTIVE') ? \PHP_SESSION_ACTIVE !== \session_status() : !\session_id()) && !\headers_sent() && !\ini_get('session.auto_start'); |