Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40285 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44953 invoked from network); 5 Sep 2008 13:59:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2008 13:59:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 69.16.228.148 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 69.16.228.148 unknown Linux 2.4/2.6 Received: from [69.16.228.148] ([69.16.228.148:52464] helo=host.fmethod.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 30/D9-27431-74B31C84 for ; Fri, 05 Sep 2008 09:59:35 -0400 Received: from [83.228.56.37] (port=1841 helo=pc) by host.fmethod.com with esmtpa (Exim 4.69) (envelope-from ) id 1KbbqV-00018S-Fg; Fri, 05 Sep 2008 08:59:31 -0500 Message-ID: To: "Antony Dovgal" Cc: "PHP Internals List" References: <20080904190717.aaz97tz688oogc4c@horde.chinstrap.eu> <48C01A91.6010501@daylessday.org> <1F1F55D1526B4BA1999B314C72CF56A6@pc> <48C0D927.7050600@daylessday.org> <928F85B0BF8247B197E9924A6D40CB6A@pc> <48C1120A.6090207@daylessday.org> Date: Fri, 5 Sep 2008 16:59:23 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.fmethod.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - fmethod.com Subject: Re: [PHP-DEV] ini-parsing, double quotes, windows in 5.3 From: sv_forums@fmethod.com ("Stan Vassilev | FM") > On 05.09.2008 14:57, Stan Vassilev | FM wrote: >> I read it. \D in the same string isn't a legal escaped combination and >> this is where the user will be warned. > > Nope. This is perfectly legal, too. > > # php -r 'var_dump("\W\H\A\T?");' > string(9) "\W\H\A\T?" > Hi, If you'll treat the INI parsing exactly as a string literal in PHP code, there's no much to be done. Your proposal is to keep a completely separate method for parsing (the current one), which also doesn't allow quote as a character (there's no way to escape it). My proposal is to have a proper subset of the PHP string literal parsing, with the additional feature of warning when a user has apparently used the slash in a way he may not have intended. You wouldn't really escape your path like this, would you: c:\Documents\\toby instead you'd go for: c:\\Documents\\toby --OR--- c:/Documents/toby Furthermore, parameters which specify pathnames can check for tabs (\t), newlines (\n, \r) and null (\0) and warn the user for a possible mistake, we don't have an actual scenario where a pathname contains tab or a newline, now do we. The upside of all this is: 1) consistent handling of PHP.ini, other INI-s, and PHP string literals 2) all those extra checks can be removed in PHP 6 or 7 after the changes "sink in" into the userbase and it becomes common knowledge that backslash needs to be escaped. Regards, Stan Vassilev