Commit f105d894 authored by Michael Fairchild's avatar Michael Fairchild
Browse files

Fix footer headings

Allow the role attribute
parent a8a3d4f9
...@@ -63,6 +63,15 @@ if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) { ...@@ -63,6 +63,15 @@ if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) {
//require_once 'HTMLPurifier.auto.php'; //require_once 'HTMLPurifier.auto.php';
$config = HTMLPurifier_Config::createDefault(); $config = HTMLPurifier_Config::createDefault();
$config->set('Cache.SerializerPath', '/tmp'); $config->set('Cache.SerializerPath', '/tmp');
//Trick the purifier into accepting HTML5 elements/attributes
$config->set('HTML.DefinitionID', 'html5-definitions'); // unqiue id
$config->set('HTML.DefinitionRev', 1);
if ($def = $config->maybeGetRawHTMLDefinition()) {
//Allow everything to have a role
$def->addAttribute('*', 'role', 'Text');
}
$purifier = new HTMLPurifier($config); $purifier = new HTMLPurifier($config);
$page->head .= '<link rel="home" href="'.htmlentities($_GET['u'], ENT_QUOTES).'" />'; $page->head .= '<link rel="home" href="'.htmlentities($_GET['u'], ENT_QUOTES).'" />';
...@@ -78,6 +87,7 @@ if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) { ...@@ -78,6 +87,7 @@ if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) {
$scannedContent = UNL_Search::removeRelativePaths($scannedContent, $_GET['u']); $scannedContent = UNL_Search::removeRelativePaths($scannedContent, $_GET['u']);
break; break;
case 'contactinfo': case 'contactinfo':
//print_r($scannedContent);exit();
$scannedContent = preg_replace('#<h3>.*</h3>#', '', $scannedContent); $scannedContent = preg_replace('#<h3>.*</h3>#', '', $scannedContent);
break; break;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment