Skip to content
Snippets Groups Projects
Commit 18f60648 authored by Stein Magne Bjorklund's avatar Stein Magne Bjorklund
Browse files

Make index.php validate

Addressing a old legacy bug. Making sure the file validate also make it
easier to spot newly introduced errors and bugs.
parent b5a65d8d
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !16. Comments created here will be created in the context of that merge request.
......@@ -17,7 +17,7 @@ if (isset($_GET['q']) && $_GET['q'] === 'import') {
// Check that application is installed.
if (!file_exists('settings.inc.php')) {
echo 'Need to configure lodspeakr first. Please run "install.sh". Alternatively, you can <a href="import">import an existing application</a>';
echo 'Need to configure lodspeakr first. Please run "install.sh". Alternatively, you can <a href="' . $_SERVER['HTTP_HOST'] . '/import">import an existing application</a>';
exit(0);
}
......@@ -48,7 +48,7 @@ $endpoints['local'] = new Endpoint($conf['endpoint']['local'], $conf['endpointPa
$acceptContentType = Utils::getBestContentType($_SERVER['HTTP_ACCEPT'], $conf['http_accept']);
$extension = Utils::getExtension($acceptContentType, $conf['http_accept']);
$uri = $conf['basedir'] . $_GET['q'];
// Check that content type is supported by LODSPeaKr.
if ($acceptContentType === null) {
......@@ -65,7 +65,6 @@ if ($conf['export'] && $_GET['q'] === 'export') {
}
// Redirect to root URL if necessary.
$uri = $conf['basedir'] . $_GET['q'];
$localUri = $uri;
if ($uri === $conf['basedir']) {
header('Location: ' . $conf['root']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment