Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ryan Dee
UNL_Search
Commits
f105d894
Commit
f105d894
authored
Jan 13, 2016
by
Michael Fairchild
Browse files
Fix footer headings
Allow the role attribute
parent
a8a3d4f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
www/index.php
View file @
f105d894
...
...
@@ -63,6 +63,15 @@ if (isset($_GET['u']) && $scanned = UNL_Search::getScannedPage($_GET['u'])) {
//require_once 'HTMLPurifier.auto.php';
$config
=
HTMLPurifier_Config
::
createDefault
();
$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
);
$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'])) {
$scannedContent
=
UNL_Search
::
removeRelativePaths
(
$scannedContent
,
$_GET
[
'u'
]);
break
;
case
'contactinfo'
:
//print_r($scannedContent);exit();
$scannedContent
=
preg_replace
(
'#<h3>.*</h3>#'
,
''
,
$scannedContent
);
break
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment