Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ RUN set -x \

COPY *.php /var/www/html/

ENV ADMINER_VERSION=5.4.1
ENV ADMINER_DOWNLOAD_SHA256=3f65364b4cc96b5e4cae1b3e448b7b6fa42b0da1eeba78bed9b3774ade830fce
ENV ADMINER_SRC_DOWNLOAD_SHA256=fd96585b1f8728b729551c5a7de3371724c1ccd701afde4c75fd6b990d935a63
ENV ADMINER_VERSION=5.4.2
ENV ADMINER_DOWNLOAD_SHA256=5b761efe7049bf586119256324fd417b49e5bb9243b40d9734fe86655e4402fd
ENV ADMINER_SRC_DOWNLOAD_SHA256=a4106d61bc81575d0b45c762105eead064384643418cad197a3257677625bd10

RUN set -x \
&& curl -fsSL https://github.com/vrana/adminer/releases/download/v$ADMINER_VERSION/adminer-$ADMINER_VERSION.php -o adminer.php \
Expand Down
6 changes: 3 additions & 3 deletions 5/fastcgi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ RUN set -x \

COPY *.php /var/www/html/

ENV ADMINER_VERSION=5.4.1
ENV ADMINER_DOWNLOAD_SHA256=3f65364b4cc96b5e4cae1b3e448b7b6fa42b0da1eeba78bed9b3774ade830fce
ENV ADMINER_SRC_DOWNLOAD_SHA256=fd96585b1f8728b729551c5a7de3371724c1ccd701afde4c75fd6b990d935a63
ENV ADMINER_VERSION=5.4.2
ENV ADMINER_DOWNLOAD_SHA256=5b761efe7049bf586119256324fd417b49e5bb9243b40d9734fe86655e4402fd
ENV ADMINER_SRC_DOWNLOAD_SHA256=a4106d61bc81575d0b45c762105eead064384643418cad197a3257677625bd10

RUN set -x \
&& curl -fsSL https://github.com/vrana/adminer/releases/download/v$ADMINER_VERSION/adminer-$ADMINER_VERSION.php -o adminer.php \
Expand Down
16 changes: 11 additions & 5 deletions 5/fastcgi/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ public function __construct(
private \Adminer\Adminer $adminer
) { }

public function loginFormField(...$args) {
return (function (...$args) {
public function loginFormField(...$args): string {
return (function (...$args): string {
$field = $this->loginFormField(...$args);

return \str_replace(
'name="auth[server]" value="" title="hostname[:port]"',
\sprintf('name="auth[server]" value="%s" title="hostname[:port]"', ($_ENV['ADMINER_DEFAULT_SERVER'] ?: 'db')),
return \preg_replace_callback(
'/name="auth\[server\]" value="" title="(?:[^"]+)"/',
static function (array $matches): string {
return \str_replace(
'value=""',
\sprintf('value="%s"', ($_ENV['ADMINER_DEFAULT_SERVER'] ?: 'db')),
$matches[0],
);
},
$field,
);
})->call($this->adminer, ...$args);
Expand Down
16 changes: 11 additions & 5 deletions 5/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ public function __construct(
private \Adminer\Adminer $adminer
) { }

public function loginFormField(...$args) {
return (function (...$args) {
public function loginFormField(...$args): string {
return (function (...$args): string {
$field = $this->loginFormField(...$args);

return \str_replace(
'name="auth[server]" value="" title="hostname[:port]"',
\sprintf('name="auth[server]" value="%s" title="hostname[:port]"', ($_ENV['ADMINER_DEFAULT_SERVER'] ?: 'db')),
return \preg_replace_callback(
'/name="auth\[server\]" value="" title="(?:[^"]+)"/',
static function (array $matches): string {
return \str_replace(
'value=""',
\sprintf('value="%s"', ($_ENV['ADMINER_DEFAULT_SERVER'] ?: 'db')),
$matches[0],
);
},
$field,
);
})->call($this->adminer, ...$args);
Expand Down