Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
7dfae28b
Commit
7dfae28b
authored
Jun 18, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #549: ability to use HTMLPurifier multiple times
parent
ae419eaf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
HtmlPurifier.php
framework/yii/helpers/HtmlPurifier.php
+3
-0
HtmlPurifier.php
framework/yii/helpers/base/HtmlPurifier.php
+3
-1
No files found.
framework/yii/helpers/HtmlPurifier.php
View file @
7dfae28b
...
@@ -26,6 +26,9 @@ namespace yii\helpers;
...
@@ -26,6 +26,9 @@ namespace yii\helpers;
*
*
* For more details please refer to HTMLPurifier documentation](http://htmlpurifier.org/).
* For more details please refer to HTMLPurifier documentation](http://htmlpurifier.org/).
*
*
* Note that you should add `ezyang/htmlpurifier` to your composer.json `require` section and run `composer install`
* before using it.
*
* @author Alexander Makarov <sam@rmcreative.ru>
* @author Alexander Makarov <sam@rmcreative.ru>
* @since 2.0
* @since 2.0
*/
*/
...
...
framework/yii/helpers/base/HtmlPurifier.php
View file @
7dfae28b
...
@@ -25,7 +25,9 @@ class HtmlPurifier
...
@@ -25,7 +25,9 @@ class HtmlPurifier
*/
*/
public
static
function
process
(
$content
,
$config
=
null
)
public
static
function
process
(
$content
,
$config
=
null
)
{
{
$purifier
=
\HTMLPurifier
::
instance
(
$config
);
$configInstance
=
\HTMLPurifier_Config
::
create
(
$config
);
$configInstance
->
autoFinalize
=
false
;
$purifier
=
\HTMLPurifier
::
instance
(
$configInstance
);
$purifier
->
config
->
set
(
'Cache.SerializerPath'
,
\Yii
::
$app
->
getRuntimePath
());
$purifier
->
config
->
set
(
'Cache.SerializerPath'
,
\Yii
::
$app
->
getRuntimePath
());
return
$purifier
->
purify
(
$content
);
return
$purifier
->
purify
(
$content
);
}
}
...
...
Write
Preview
Markdown
is supported
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