diff options
Diffstat (limited to 'plugins/openid/lib/Auth/OpenID/Parse.php')
-rw-r--r-- | plugins/openid/lib/Auth/OpenID/Parse.php | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/plugins/openid/lib/Auth/OpenID/Parse.php b/plugins/openid/lib/Auth/OpenID/Parse.php index 9c0a255e..2e830e9c 100644 --- a/plugins/openid/lib/Auth/OpenID/Parse.php +++ b/plugins/openid/lib/Auth/OpenID/Parse.php @@ -89,24 +89,24 @@ class Auth_OpenID_Parse { /** * Specify some flags for use with regex matching. */ - var $_re_flags = "si"; + public $_re_flags = "si"; /** * Stuff to remove before we start looking for tags */ - var $_removed_re = + public $_removed_re = "<!--.*?-->|<!\[CDATA\[.*?\]\]>|<script\b(?!:)[^>]*>.*?<\/script>"; /** * Starts with the tag name at a word boundary, where the tag name * is not a namespace */ - var $_tag_expr = "<%s\b(?!:)([^>]*?)(?:\/>|>(.*)(?:<\/?%s\s*>|\Z))"; + public $_tag_expr = "<%s\b(?!:)([^>]*?)(?:\/>|>(.*)(?:<\/?%s\s*>|\Z))"; - var $_attr_find = '\b(\w+)=("[^"]*"|\'[^\']*\'|[^\'"\s\/<>]+)'; + public $_attr_find = '\b(\w+)=("[^"]*"|\'[^\']*\'|[^\'"\s\/<>]+)'; - var $_open_tag_expr = "<%s\b"; - var $_close_tag_expr = "<((\/%s\b)|(%s[^>\/]*\/))>"; + public $_open_tag_expr = "<%s\b"; + public $_close_tag_expr = "<((\/%s\b)|(%s[^>\/]*\/))>"; function __construct() { @@ -136,6 +136,10 @@ class Auth_OpenID_Parse { /** * Returns a regular expression that will match a given tag in an * SGML string. + * + * @param string $tag_name + * @param array $close_tags + * @return string */ function tagMatcher($tag_name, $close_tags = null) { @@ -215,24 +219,13 @@ class Auth_OpenID_Parse { return $str; } } - + function match($regexp, $text, &$match) { - if (!is_callable('mb_ereg_search_init')) { - if (!preg_match($regexp, $text, $match)) { - return false; - } - $match = $match[0]; - return true; + if (preg_match($regexp, $text, $match)) { + return true; } - - $regexp = substr($regexp, 1, strlen($regexp) - 2 - strlen($this->_re_flags)); - mb_ereg_search_init($text); - if (!mb_ereg_search($regexp)) { - return false; - } - $match = mb_ereg_search_getregs(); - return true; + return false; } /** |