Skip to content

Commit 999e9cb

Browse files
Restrict ajax.php to installer actions when INSTALL_BLOCK is missing
1 parent d607279 commit 999e9cb

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

ajax.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,31 @@
7474
die();
7575
}
7676

77+
$installerActive = (!file_exists('INSTALL_BLOCK'));
78+
if ($installerActive)
79+
{
80+
$module = '';
81+
if (strpos($_REQUEST['f'], ':') !== false)
82+
{
83+
$parameters = explode(':', $_REQUEST['f']);
84+
$module = preg_replace("/[^A-Za-z0-9]/", "", $parameters[0]);
85+
}
86+
87+
if ($module !== 'install')
88+
{
89+
header('Content-type: text/xml');
90+
echo '<?xml version="1.0" encoding="', AJAX_ENCODING, '"?>', "\n";
91+
echo(
92+
"<data>\n" .
93+
" <errorcode>-1</errorcode>\n" .
94+
" <errormessage>Installer is active; only installer AJAX actions are allowed.</errormessage>\n" .
95+
"</data>\n"
96+
);
97+
98+
die();
99+
}
100+
}
101+
77102
if (strpos($_REQUEST['f'], ':') === false)
78103
{
79104
$function = preg_replace("/[^A-Za-z0-9]/", "", $_REQUEST['f']);

0 commit comments

Comments
 (0)