Skip to content
Snippets Groups Projects
Commit 1ffefcbc 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 4c5377c2
No related branches found
No related tags found
1 merge request!16Resolve "Introduce PSR-4 autoloading"
...@@ -17,7 +17,7 @@ if (isset($_GET['q']) && $_GET['q'] === 'import') { ...@@ -17,7 +17,7 @@ if (isset($_GET['q']) && $_GET['q'] === 'import') {
// Check that application is installed. // Check that application is installed.
if (!file_exists('settings.inc.php')) { 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); exit(0);
} }
...@@ -48,7 +48,7 @@ $endpoints['local'] = new Endpoint($conf['endpoint']['local'], $conf['endpointPa ...@@ -48,7 +48,7 @@ $endpoints['local'] = new Endpoint($conf['endpoint']['local'], $conf['endpointPa
$acceptContentType = Utils::getBestContentType($_SERVER['HTTP_ACCEPT'], $conf['http_accept']); $acceptContentType = Utils::getBestContentType($_SERVER['HTTP_ACCEPT'], $conf['http_accept']);
$extension = Utils::getExtension($acceptContentType, $conf['http_accept']); $extension = Utils::getExtension($acceptContentType, $conf['http_accept']);
$uri = $conf['basedir'] . $_GET['q'];
// Check that content type is supported by LODSPeaKr. // Check that content type is supported by LODSPeaKr.
if ($acceptContentType === null) { if ($acceptContentType === null) {
...@@ -65,7 +65,6 @@ if ($conf['export'] && $_GET['q'] === 'export') { ...@@ -65,7 +65,6 @@ if ($conf['export'] && $_GET['q'] === 'export') {
} }
// Redirect to root URL if necessary. // Redirect to root URL if necessary.
$uri = $conf['basedir'] . $_GET['q'];
$localUri = $uri; $localUri = $uri;
if ($uri === $conf['basedir']) { if ($uri === $conf['basedir']) {
header('Location: ' . $conf['root']); 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