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
mahara
mahara
Commits
2d2c1854
Commit
2d2c1854
authored
Mar 10, 2009
by
Nigel McNie
Browse files
Added HTML filter for slideshare.net
Conflicts: htdocs/lib/version.php
parent
311e012e
Changes
4
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/db/upgrade.php
View file @
2d2c1854
...
...
@@ -856,6 +856,10 @@ function xmldb_core_upgrade($oldversion=0) {
}
}
if
(
$oldversion
<
2009031000
)
{
reload_html_filters
();
}
return
$status
;
}
...
...
htdocs/lib/htmlpurifiercustom/SlideShare.php
0 → 100644
View file @
2d2c1854
<?php
class
HTMLPurifier_Filter_SlideShare
extends
HTMLPurifier_Filter
{
public
$name
=
'SlideShare'
;
public
function
preFilter
(
$html
,
$config
,
$context
)
{
$pre_regex
=
'#<embed\b[^>]+\bsrc="http://static.slideshare.net/swf/ssplayer2.swf\?(doc=[a-z0-9-]+)[^>]+>\s*</embed>#s'
;
$pre_replace
=
'<span class="slideshare-embed">\1</span>'
;
return
preg_replace
(
$pre_regex
,
$pre_replace
,
$html
);
}
public
function
postFilter
(
$html
,
$config
,
$context
)
{
$post_regex
=
'#<span class="slideshare-embed">(doc=[a-z0-9-]+)</span>#'
;
$post_replace
=
'<object width="400" height="355" data="http://static.slideshare.net/swf/ssplayer2.swf?\1">'
.
'<param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?\1" />'
.
'<!--[if IE]>'
.
'<embed style="width:400px; height:355px;" '
.
'id="VideoPlayback" '
.
'type="application/x-shockwave-flash" '
.
'src="http://static.slideshare.net/swf/ssplayer2.swf?\1" '
.
'flashvars="" '
.
'</embed>'
.
'<![endif]-->'
.
'</object>'
;
return
preg_replace
(
$post_regex
,
$post_replace
,
$html
);
return
$html
;
}
}
htdocs/lib/htmlpurifiercustom/filters.xml
View file @
2d2c1854
...
...
@@ -20,4 +20,8 @@
<filename>
Twitter
</filename>
<site>
http://twitter.com
</site>
</filter>
<filter>
<filename>
SlideShare
</filename>
<site>
http://slideshare.net
</site>
</filter>
</filters>
htdocs/lib/version.php
View file @
2d2c1854
...
...
@@ -27,7 +27,7 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
20090
228
00
;
$config
->
version
=
20090
310
00
;
$config
->
release
=
'1.2.0dev'
;
$config
->
minupgradefrom
=
2008040200
;
$config
->
minupgraderelease
=
'1.0.0 (release tag 1.0.0_RELEASE)'
;
...
...
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