Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70674 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17858 invoked from network); 16 Dec 2013 20:44:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Dec 2013 20:44:45 -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.216.182 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.182 mail-qc0-f182.google.com Received: from [209.85.216.182] ([209.85.216.182:36449] helo=mail-qc0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/1F-32483-C366FA25 for ; Mon, 16 Dec 2013 15:44:45 -0500 Received: by mail-qc0-f182.google.com with SMTP id e16so4081503qcx.41 for ; Mon, 16 Dec 2013 12:44:42 -0800 (PST) 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:message-id :subject:to:content-type; bh=OVy0hYKPRFcE2sIZlkj7NzYyiuL6XAoCg5tESCSZlYs=; b=mONfF5wgCQenGI5X+eHHtg8tOuH7siExn4/PJ0EkC4EIgWC0+Ex83LPLYzl847Fra0 Q+Ec3PIg4iuf8nB5/6TNI91UWlqsNjev+4isidEyZ9nwcx+hbgJ49/1Z/bhf4ANRiBd0 UjWbpKWq+fTk0ETT3XlnHww71qbkW1T+cuGCtKtdJtrjjQYFcK/6GBHEO65ClXD+4NHP qn6yCQfZjVmPqH9LVJZedeKYNJFIWvM7OQI+BiB//mycrik3Ogyfe0gnNHQx+YGE7TQZ +s63qgkbogwbsK4blnMrT2nWMUIo6WpOTN3WNkG8e/cFpj90BR7U2bRPr4y8KkpWODwp xsgA== X-Received: by 10.229.140.129 with SMTP id i1mr35829443qcu.13.1387226682260; Mon, 16 Dec 2013 12:44:42 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.224.23.129 with HTTP; Mon, 16 Dec 2013 12:44:02 -0800 (PST) In-Reply-To: References: Date: Tue, 17 Dec 2013 05:44:02 +0900 X-Google-Sender-Auth: g53NoeGj7pNaiX1XPQIG7Ef-BXI Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1132ecf09e84a304edace1bc Subject: Re: Making addslashes() multibyte aware From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a1132ecf09e84a304edace1bc Content-Type: text/plain; charset=UTF-8 Hi all, On Sat, Dec 14, 2013 at 1:22 PM, Yasuo Ohgaki wrote: > escapeshellargs()/fgetcsv() have multibyte char support via mblen() which > depends on LC_TYPE, but addslashes() don't take into count MBCS at all. > > addslashes() could behave like escapeshellargs(). Current addslashes() > is not usable with SJIS/BIG5/etc. > > Depending on locale is problematic. Is it safe with multi threaded SAPI? > Using mbstring feature and introduce encoding php.ini setting might be > better. > > Any comment making addslashes() locale aware? and/or current > escapeshellargs()/fgetcsv() implementation? > I don't think locale based MBCS support is optimum, but I'll add it to addslashes() for now. Question is where should I start? It's security issue for certain char encodings such as SJIS/BIG5. I'll fix php_addslashes(). Therefore, any functions that use it internally are affected. e.g. var_export(), etc. Users are not affected as long as they are using correct locale. Should I fix this from 5.3? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a1132ecf09e84a304edace1bc--