Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c4a12af
)
MDL-22896 libraries: Updated regular expression in html2text, for replacing unknown...
author
Rajesh Taneja
<rajesh@moodle.com>
Tue, 21 Feb 2012 08:31:20 +0000
(16:31 +0800)
committer
Rajesh Taneja
<rajesh@moodle.com>
Fri, 24 Feb 2012 02:08:56 +0000
(10:08 +0800)
lib/html2text.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/html2text.php
b/lib/html2text.php
index
e360b2c
..
0320433
100644
(file)
--- a/
lib/html2text.php
+++ b/
lib/html2text.php
@@
-470,7
+470,7
@@
class html2text
$text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
// Remove unknown/unhandled entities (this cannot be done in search-and-replace block)
- $text = preg_replace('/&
[^&;]+;/i
', '', $text);
+ $text = preg_replace('/&
([a-zA-Z0-9]{2,6}|#[0-9]{2,4});/
', '', $text);
// Strip any other HTML tags
$text = strip_tags($text, $this->allowed_tags);