Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67919 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87913 invoked from network); 27 Jun 2013 07:04:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jun 2013 07:04:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.48 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.48 mail-la0-f48.google.com Received: from [209.85.215.48] ([209.85.215.48:37065] helo=mail-la0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/D6-51393-5E3EBC15 for ; Thu, 27 Jun 2013 03:04:06 -0400 Received: by mail-la0-f48.google.com with SMTP id lx15so388591lab.7 for ; Thu, 27 Jun 2013 00:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=eQ5F2jWwYikrKhejjc9EV3aN6rMeDiiXg09j5ZAa1xM=; b=quknCvDmb/DtxOiJ8AjxDzNetR7MQqV9dFvKy2jvf4Ixp8VmIQbUoapZtlkalA8svv YASNPxM+Bjne7ZELTB114G5AUDjQi/FcaOv0yisdBQ9olKqAwpLnxgQ1pcZlELcyJCbv aWeO1kAFqtyDKJK2NWsjRWGr3wEdDtN8+y4HYGW1248H941L8AG9nwzdAWz6Rk3pMdYk JeDSjedBQfUPCVbZlMePyI2PKhzz84T55V1uDn/hv+c/YN0F8LUmVkrrpLRGXsJYGSfQ Vn4wI4GHURQP7QTX9bBy4Cx939rUdZMDoU8kRkcD0WOxSsmZVsMsqb2gcylr1x7VTU06 ToUA== X-Received: by 10.112.219.102 with SMTP id pn6mr3663711lbc.18.1372316641459; Thu, 27 Jun 2013 00:04:01 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.4.233 with HTTP; Thu, 27 Jun 2013 00:03:21 -0700 (PDT) In-Reply-To: References: Date: Thu, 27 Jun 2013 16:03:21 +0900 X-Google-Sender-Auth: xGJGF19F0jTkIpwMnPGQcyJBmsc Message-ID: To: Kris Craig Cc: PHP internals list Content-Type: multipart/alternative; boundary=001a11c3ca14ef030904e01d5de9 Subject: Re: [PHP-DEV] ENT_ALL or similar option for htmlspecialchars[_decode]? From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c3ca14ef030904e01d5de9 Content-Type: text/plain; charset=ISO-8859-1 2013/6/27 Kris Craig > I just noticed that htmlspecialchars_decode doesn't convert entities like > and . > I think htmlspecialchars_decode() only decodes ext/standard/html_tables.h static const entity_stage3_row stage3_table_be_apos_00000[] = { {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"quot", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"amp", 3} } }, {0, { {"apos", 4} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {NULL, 0} } }, {0, { {"lt", 2} } }, {0, { {NULL, 0} } }, {0, { {"gt", 2} } }, {0, { {NULL, 0} } }, }; IIRC I may be wrong. > Is there a bitmask I'm missing or are those simply not > supported right now? If the latter, any thoughts on adding something along > the lines of ENT_ALL to convert all valid entities from/to their respective > characters? > What you are looking for is html_entity_decode(), I think. $ php -n -r 'var_dump(html_entity_decode(" ="));' string(2) " =" Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c3ca14ef030904e01d5de9--