Re: Re: Making addslashes() multibyte aware

From: Date: Mon, 16 Dec 2013 22:13:07 +0000
Subject: Re: Re: Making addslashes() multibyte aware
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-70681@lists.php.net to get a copy of this message
On Mon, Dec 16, 2013 at 4:41 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote: > On Tue, Dec 17, 2013 at 5:54 AM, Adam Harvey <aharvey@php.net> wrote: > > > On 16 December 2013 12:44, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote: > > > 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? > > > > This feels like it has the potential to be a really nasty implicit BC > > break. I don't think we'd want to change default behaviour on any > > stable branch, honestly. > > > I cannot object this argument. > There may be unexpected side effects. > However, users will not be affected as long as they are using correct > locale if locale system is not broken... > > But honestly, how many users will set their locale to SJIS/BIG5 when dealing with multibyte charsets like those? I typically never touch locales when dealing with code that handles multibyte charsets (and that's becoming more and more often these days), because it rarely makes sense. It makes a lot more sense to me to deal with those issues on the intl/mb_* level and as for serialization I hardly think that serialize() with addslashes is a problem PHP needs to fix. More likely the correct and better fix is for those developers to be more charset-conscious while making decisions about how to handle serialized data after transport.

« previous php.internals (#70681) next »