Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-22896 libraries: Updated regular expression in html2text, for rep…

…lacing unknown/unhandled entities
  • Loading branch information...
commit cd1a0a72a57de209d23815bc6cd4af5694f08457 1 parent d1c12af
@rajeshtaneja rajeshtaneja authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/html2text.php
View
2  lib/html2text.php
@@ -470,7 +470,7 @@ function _convert()
$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);
Please sign in to comment.
Something went wrong with that request. Please try again.