php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43928 Using periods in encapsulated variables returns white page
Submitted: 2008-01-24 14:54 UTC Modified: 2008-01-24 16:21 UTC
From: david dot reade at sbhelp dot co dot uk Assigned:
Status: Not a bug Package: Variables related
PHP Version: 5.2.5 OS: CentOS 5.1
Private report: No CVE-ID: None
 [2008-01-24 14:54 UTC] david dot reade at sbhelp dot co dot uk
Description:
------------
Using dots in queries, e.g. "/index.php?this.is.a.test", which returns a white page with no error, even with 'error_reporting(E_ALL)'. However using any other symbol, such as a colon, returns the correct result.

Reproduce code:
---------------
<?php
    if(isset($_GET['this.is.a.test'])) {
        echo('It works!'); exit();
    }
    if(isset($_GET['this;is;a;test'])) {
        echo('It works!'); exit();
    }
    if(isset($_GET['this;is;a;test'])) {
        echo('It works!'); exit();
    }
?>

Expected result:
----------------
It works!

Actual result:
--------------
/index.php?this.is.a.test = <white page, no error>
/index.php?this;is;a;test = 'It works!'
/index.php?this:is:a:test = 'It works!'

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-24 14:55 UTC] david dot reade at sbhelp dot co dot uk
Reproduce code should actually read:

<?php
    if(isset($_GET['this.is.a.test'])) {
        echo('It works!'); exit();
    }
    if(isset($_GET['this;is;a;test'])) {
        echo('It works!'); exit();
    }
    if(isset($_GET['this:is:a:test'])) {
        echo('It works!'); exit();
    }
?>
 [2008-01-24 15:01 UTC] arnaud dot lb at gmail dot com
PHP replaces "." with "_" in variables names.

Try isset($_GET['this_is_a_test'])  ;)
 [2008-01-24 16:21 UTC] felipe@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

http://www.php.net/manual/en/language.variables.external.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 11 22:01:45 2024 UTC