mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-05 22:52:49 +08:00
修复标签属性不支持-的问题
This commit is contained in:
@@ -645,7 +645,7 @@ class Template
|
||||
*/
|
||||
public function parseAttr($str, $name = null)
|
||||
{
|
||||
$regex = '/\s+(?>(?<name>\w+)\s*)=(?>\s*)([\"\'])(?<value>(?:(?!\\2).)*)\\2/is';
|
||||
$regex = '/\s+(?>(?<name>[\w-]+)\s*)=(?>\s*)([\"\'])(?<value>(?:(?!\\2).)*)\\2/is';
|
||||
$array = [];
|
||||
if (preg_match_all($regex, $str, $matches, PREG_SET_ORDER)) {
|
||||
foreach ($matches as $match) {
|
||||
|
||||
Reference in New Issue
Block a user