up
This commit is contained in:
@@ -35,6 +35,8 @@ $bridgeConfig = [
|
||||
'tables_allow' => [], // optional whitelist: ['customers', 'orders']
|
||||
];
|
||||
|
||||
// {{BRIDGE_DB_SETUP}}
|
||||
|
||||
$localOverride = __DIR__ . '/emailtemplate.bridge.conf.php';
|
||||
if (is_file($localOverride)) {
|
||||
$override = include $localOverride;
|
||||
@@ -96,6 +98,35 @@ function bridgeDb(array $config): PDO
|
||||
return $pdo;
|
||||
}
|
||||
|
||||
function bridge_array_get($data, string $path, $default = null)
|
||||
{
|
||||
if (is_object($data)) {
|
||||
$data = (array)$data;
|
||||
}
|
||||
if (!is_array($data)) {
|
||||
return $default;
|
||||
}
|
||||
$path = trim($path);
|
||||
if ($path === '') {
|
||||
return $data;
|
||||
}
|
||||
$segments = array_values(array_filter(array_map('trim', explode('.', $path)), static function ($segment) {
|
||||
return $segment !== '';
|
||||
}));
|
||||
foreach ($segments as $segment) {
|
||||
if (is_array($data) && array_key_exists($segment, $data)) {
|
||||
$value = $data[$segment];
|
||||
if (is_object($value)) {
|
||||
$value = (array)$value;
|
||||
}
|
||||
$data = $value;
|
||||
} else {
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
bridgeRequireToken($bridgeConfig);
|
||||
|
||||
$action = strtolower((string)($_GET['action'] ?? $_POST['action'] ?? 'schema'));
|
||||
|
||||
Reference in New Issue
Block a user