Skip to content
Snippets Groups Projects
Commit 181e7855 authored by Kevin Abel's avatar Kevin Abel
Browse files

Fix local template region population failing for certain sites.

If the titlegraphic region is missing, it is more likely that the entire
scanned page is missing proper regions.
parent 88a0308d
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,7 @@ $page->addStyleSheet('css/search.css');
if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) {
// Add local site search results
// we're scrapping the navigation and other content from the originatting site.
if (!$isEmbed && isset($scanned->navlinks)) {
if (!$isEmbed && isset($scanned->titlegraphic)) {
require_once 'HTMLPurifier.auto.php';
$config = HTMLPurifier_Config::createDefault();
$config->set('Cache.SerializerPath', '/tmp');
......@@ -68,11 +68,7 @@ if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) {
$page->breadcrumbs = $purifier->purify(UNL_Search::removeRelativePaths($scanned->breadcrumbs, $_GET['u']));
$page->titlegraphic = $purifier->purify(str_replace(array('<h1>', '</h1>'), '',$scanned->titlegraphic));
$page->navlinks = $purifier->purify(UNL_Search::removeRelativePaths($scanned->navlinks, $_GET['u']));
if (!empty($scanned->leftcollinks)) {
$page->leftcollinks = $purifier->purify($scanned->leftcollinks);
}
if (!empty($scanned->contactinfo)) {
$page->contactinfo = $purifier->purify(preg_replace('#<h3>.*</h3>#', '', $scanned->contactinfo));
}
if (!empty($scanned->footercontent)) {
......
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