From 884e036a46bd8cea52e680bf67e8522bdd2b7196 Mon Sep 17 00:00:00 2001 From: oldrind <1401019000@qq.com> Date: Mon, 29 Feb 2016 09:43:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=87=E7=AD=BE=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E4=B8=8D=E6=94=AF=E6=8C=81-=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Template.php | 2 +- tests/thinkphp/library/think/templateTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/Template.php b/library/think/Template.php index c57ff89c..7d14e354 100644 --- a/library/think/Template.php +++ b/library/think/Template.php @@ -645,7 +645,7 @@ class Template */ public function parseAttr($str, $name = null) { - $regex = '/\s+(?>(?\w+)\s*)=(?>\s*)([\"\'])(?(?:(?!\\2).)*)\\2/is'; + $regex = '/\s+(?>(?[\w-]+)\s*)=(?>\s*)([\"\'])(?(?:(?!\\2).)*)\\2/is'; $array = []; if (preg_match_all($regex, $str, $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { diff --git a/tests/thinkphp/library/think/templateTest.php b/tests/thinkphp/library/think/templateTest.php index b044a5b6..0cdc2757 100644 --- a/tests/thinkphp/library/think/templateTest.php +++ b/tests/thinkphp/library/think/templateTest.php @@ -257,7 +257,7 @@ EOF; $_GET['action'] = 'action'; $_POST['action'] = 'action'; $_COOKIE['name'] = 'name'; - \think\Session::set('action', ['name' => 'name']); + $_SESSION['action'] = ['name' => 'name']; define('SITE_NAME', 'site_name'); $content = <<