# Remove name mangling? (when creating variables from external sources)

- Thread: https://externals.io/message/88708
- Original archive: https://news-web.php.net/php.internals/88708
- Started by Bishop Bettini on 2015-10-06T20:38:51+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #88708 — Bishop Bettini — 2015-10-06T20:38:51+00:00

URL: https://externals.io/message/88708#88708

Hi!

Currently dots and spaces are converted to underscores when pulling them in
from HTML:

    <!-- php will only see two submitted values, b/c of mangling -->
    <input type='file' name='file5.1' />
    <input type='file' name='file5 1' />
    <input type='file' name='file5_1' />
    <input type='text' name='file5.1' />
    <input type='text' name='file5 1' />
    <input type='text' name='file5_1' />

Ostensibly[1], names were mangled to support import_request_variables and
register_globals.  But curiously other characters that would create an
invalid variable aren't mangled:

    <input type='text' name='file5$1' /> <!-- why not mangle $ also? -->

There are already two bug requests out there asking to remove this behavior
or expose the original name: #34882 and #42055

Since 5.4.0 removed both import_request_variables and register_globals,
does this mangling serve any purpose?  If not, can we remove it?


[1] http://php.net/manual/en/language.variables.external.php
[2] https://bugs.php.net/bug.php?id=34882
[3] https://bugs.php.net/bug.php?id=42055

---

## #88709 — Anthony Ferrara — 2015-10-06T21:21:02+00:00

URL: https://externals.io/message/88708#88709 · In reply to: #88708

Hey,


> Hi!
>
> Currently dots and spaces are converted to underscores when pulling them in
> from HTML:
>
>     <!-- php will only see two submitted values, b/c of mangling -->
>     <input type='file' name='file5.1' />
>     <input type='file' name='file5 1' />
>     <input type='file' name='file5_1' />
>     <input type='text' name='file5.1' />
>     <input type='text' name='file5 1' />
>     <input type='text' name='file5_1' />
>
> Ostensibly[1], names were mangled to support import_request_variables and
> register_globals.  But curiously other characters that would create an
> invalid variable aren't mangled:
>
>     <input type='text' name='file5$1' /> <!-- why not mangle $ also? -->
>
> There are already two bug requests out there asking to remove this behavior
> or expose the original name: #34882 and #42055
>
> Since 5.4.0 removed both import_request_variables and register_globals,
> does this mangling serve any purpose?  If not, can we remove it?
>
>
> [1] http://php.net/manual/en/language.variables.external.php
> [2] https://bugs.php.net/bug.php?id=34882
> [3] https://bugs.php.net/bug.php?id=42055

I'm all for this. Mangling has always seemed ...weird... Pulling it
out is awesome.

However, it also would be a pretty non-trivial BC break for people who
rely on the mangling. This would be likely something for 8?

Anthony
