Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
3e3a4bd9
Commit
3e3a4bd9
authored
Jan 13, 2009
by
Nigel McNie
Browse files
Enabled auto-linking in HTML content. Some cleanup of clean_text while I was there.
Conflicts: htdocs/lib/web.php
parent
1abb7073
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/web.php
View file @
3e3a4bd9
...
...
@@ -2143,17 +2143,10 @@ function clean_html($text) {
$config
=
HTMLPurifier_Config
::
createDefault
();
$config
->
set
(
'Cache'
,
'SerializerPath'
,
get_config
(
'dataroot'
)
.
'htmlpurifier'
);
$config
->
set
(
'HTML'
,
'DefinitionID'
,
'Mahara customisations to default config'
);
// NOTE: this MUST be incremented if you change the configuration
// definition - Talk to Nigel about it
$config
->
set
(
'HTML'
,
'DefinitionRev'
,
1
);
// This disables caching of HTMLPurifier objects. Worth having off for
// development, but see note above once you're done messing with things
//$config->set('Core', 'DefinitionCache', null);
$config
->
set
(
'Core'
,
'Encoding'
,
'UTF-8'
);
$config
->
set
(
'HTML'
,
'Doctype'
,
'XHTML 1.0 Transitional'
);
$config
->
set
(
'AutoFormat'
,
'Linkify'
,
true
);
$customfilters
=
array
();
if
(
get_config
(
'filters'
))
{
foreach
(
unserialize
(
get_config
(
'filters'
))
as
$filter
)
{
...
...
@@ -2167,6 +2160,14 @@ function clean_html($text) {
}
$config
->
set
(
'Filter'
,
'Custom'
,
$customfilters
);
}
// These settings help identify the configuration definition. If the
// definition (the $def object below) is changed (e.g. new method calls
// made on it), the DefinitionRev needs to be increased. See
// http://htmlpurifier.org/live/configdoc/plain.html#HTML.DefinitionID
$config
->
set
(
'HTML'
,
'DefinitionID'
,
'Mahara customisations to default config'
);
$config
->
set
(
'HTML'
,
'DefinitionRev'
,
1
);
$def
=&
$config
->
getHTMLDefinition
(
true
);
$def
->
addAttribute
(
'a'
,
'target'
,
'Enum#_blank,_self,_target,_top'
);
$purifier
=
new
HTMLPurifier
(
$config
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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