Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3518
StripMarkup.php
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 9:31 PM
2014-11-21 21:31:22 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
StripMarkup.php
View Options
<?php
if
(
!
defined
(
'MEDIAWIKI'
)
)
die
();
# @package MediaWiki
# @subpackage Extensions
#
# MediaWiki Strip Markup extension
# To install, copy the extension to your extensions directory and add line
# include("extensions/StripMarkup.php");
# to the bottom of your LocalSettings.php
#
# @author Steve Sanbeg
# @copyright Copyright © 2006, Steve Sanbeg
# @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
$wgExtensionFunctions
[]=
"wfStripMarkupExtension"
;
$wgExtensionCredits
[
'parserhook'
][]
=
array
(
'name'
=>
'StripMarkup'
,
'author'
=>
'Steve Sanbeg'
,
'description'
=>
'adds <nowiki><stripmarkup></nowiki> tag'
,
'url'
=>
'http://www.mediawiki.org/wiki/Extension:Strip_Markup'
);
function
wfStripMarkupExtension
()
{
$GLOBALS
[
'wgParser'
]->
setHook
(
"stripmarkup"
,
"StripMarkupExtension"
);
}
function
StripMarkupExtension
(
$text
,
$param
=
array
(),
$parser
=
null
)
{
if
(
method_exists
(
$parser
,
'recursiveTagParse'
))
{
$text
=
$parser
->
recursiveTagParse
(
$text
);
}
else
{
$ret
=
$parser
->
parse
(
$text
,
$parser
->
mTitle
,
$parser
->
mOptions
,
// We begin at line start
true
,
// Important, otherwise $this->clearState()
// would get run every time <ref> or
// <references> is called, fucking the whole
// thing up.
false
);
$text
=
$ret
->
getText
();
}
return
Sanitizer
::
stripAllTags
(
$text
);
}
?>
File Metadata
Details
Attached
Mime Type
text/x-php
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3085
Default Alt Text
StripMarkup.php (1 KB)
Attached To
Mode
T10161: Syntax for stripping HTML and wiki markup
Attached
Detach File
Event Timeline
Log In to Comment