Skip to content
Snippets Groups Projects

Resolve "Remove all use of GLOBALS"

Merged Stein Magne Bjorklund requested to merge 13-remove-all-use-of-globals into master
1 file
+ 7
1
Compare changes
  • Side-by-side
  • Inline
@@ -45,24 +45,30 @@ class UriModule implements ModuleInterface
#Fix to handle pages that have not been loaded after cleaning out database
$localUri_stripped = preg_replace("/^(.+)\.html$/i", "\\1", $localUri);
$uri_stripped = preg_replace("/^(.+)\.html$/i", "\\1", $uri);
if ($pair == null) { // Original URI is not in metadata
if ($pair === null) { // Original URI is not in metadata
if (Queries::uriExist($uri_stripped, $this->endpoints)) {
$page = Queries::createPage($uri_stripped, $localUri_stripped, $acceptContentType, $metaDb);
if ($page == null) {
HTTPStatus::send500("Can't write sqlite database.");
}
HTTPStatus::send303($page, $acceptContentType);
exit(0);
} else {
return false;
}
}
$extension = Utils::getExtension($pair[2], $conf['http_accept']);
$curie = Utils::uri2curie($pair[0]);
list($modelFile, $viewFile) = $this->getModelandView($curie, $extension);
if ($modelFile == null) {
return false;
}
$result = array(
'res' => $pair[0],
'page' => $pair[1],
Loading