mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
修复了在php5.4以上版本中pcre库版本略低出现的preg_match或preg_match_all函数报无法识别字符错误,并且可以向上兼容
This commit is contained in:
@@ -224,7 +224,7 @@ class TagLib
|
||||
*/
|
||||
public function parseAttr($str, $name, $alias = '')
|
||||
{
|
||||
$regex = '/\s+(?>(?<name>[\w-]+)\s*)=(?>\s*)([\"\'])(?<value>(?:(?!\\2).)*)\\2/is';
|
||||
$regex = '/\s+(?>(?P<name>[\w-]+)\s*)=(?>\s*)([\"\'])(?P<value>(?:(?!\\2).)*)\\2/is';
|
||||
$result = [];
|
||||
if (preg_match_all($regex, $str, $matches)) {
|
||||
foreach ($matches['name'] as $key => $val) {
|
||||
|
||||
Reference in New Issue
Block a user