Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80504 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80576 invoked from network); 14 Jan 2015 23:34:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2015 23:34:01 -0000 Authentication-Results: pb1.pair.com header.from=marcio.web2@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=marcio.web2@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.178 as permitted sender) X-PHP-List-Original-Sender: marcio.web2@gmail.com X-Host-Fingerprint: 209.85.217.178 mail-lb0-f178.google.com Received: from [209.85.217.178] ([209.85.217.178:56102] helo=mail-lb0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 36/C2-00659-7ECF6B45 for ; Wed, 14 Jan 2015 18:34:00 -0500 Received: by mail-lb0-f178.google.com with SMTP id u14so10578679lbd.9 for ; Wed, 14 Jan 2015 15:33:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:from:date:message-id:subject:to:content-type; bh=lzFYCimCj8uTw1cZMXYB9B5T6EtQ8EZC9F3pD9UhrPU=; b=l2eJst5gn+99SWp775c5prRLo29Itht7GTHpR+UAEz9a96kAqIf7GKyGaGt/SzFGWP ff34MxSRzOjlWZVlViW1PT75Z1GmuanXVsOq07DsnzQuyRIXAw6NJGNnu5URgyTk1621 wASecXroQp6BC5InQyJfvrEXg625wG0qVn9SlwhCMlafT4nrzV47k+UxU8K5Sq4yOFgO 9VdagDEKJxafGy0QCf0oqI1CCOZRsWPOA5NBW8ytFcXyKWq1FFaqMIqMkfJuUD8oBBqH GP2gmDLK+2h9SidBAVMdHWx5khJlpUyLT0OYk3B8uBEivI3XGxoQ3VtuDs82FbE3LO6a SkLg== X-Received: by 10.152.205.104 with SMTP id lf8mr6681471lac.94.1421278435957; Wed, 14 Jan 2015 15:33:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.152.21.101 with HTTP; Wed, 14 Jan 2015 15:33:35 -0800 (PST) Reply-To: marcio3w@gmail.com Date: Wed, 14 Jan 2015 20:33:35 -0300 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=001a1133a5744d606e050ca52cc6 Subject: [PHP_DEV] Possible RFC From: marcio.web2@gmail.com (Marcio Almada) --001a1133a5744d606e050ca52cc6 Content-Type: text/plain; charset=UTF-8 Hi, I'd like to propose an RFC to convert PCRE compilation E_WARNINGs to E_RECOVERABLE_ERRORs, so I'm opening a prior discussion to see how viable this could be. The reason is quite simple. If userland code is using malformed regular expressions, this is probably a programmer's mistake caused by lack of attention or lack of knowledge about PCRE flavor. In any case, program execution should be halted because the given regular expression is not working as expected. Consider the following (lame) code example: function securityCheck($input) { if (! preg_match('/some malformed regex', $input)) throw new Exception("Dangerous user input!"); } } // the regexp is malformed so // none of the following calls will throw exception :( securityCheck($good_input); securityCheck($danger_input); This could cause a minor BC break for programs already running with malformed regexp, but that's the hole purpose of this discussion. Do you think such RFC would be a good idea? Regards, Marcio Almada. --001a1133a5744d606e050ca52cc6--