[wp-trac] [WordPress Trac] #27157: Theme template issue in handling form submission with a specific name in input type text.
WordPress Trac
noreply at wordpress.org
Wed Feb 19 09:50:01 UTC 2014
#27157: Theme template issue in handling form submission with a specific name in
input type text.
--------------------------+-----------------------
Reporter: abhineet | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Themes | Version: 3.8.1
Severity: normal | Resolution: invalid
Keywords: | Focuses: template
--------------------------+-----------------------
Changes (by SergeyBiryukov):
* status: new => closed
* resolution: => invalid
* milestone: Awaiting Review =>
Old description:
> Hi,
> I just noticed that there's a bug in wordpress template handling.
> If we create a page & selected custom template in which a form submit is
> written & uses 'name' as name in input field then it forces wordpress to
> redirect to 404 page instead of template page itself.
>
> {{{
> <input class="username" type="text" name="name">
> }}}
>
> Step to create this bug:
> 1) Create a template & write form submit code in it.
>
> {{{
> <form name="myForm" method="post" action="<?php echo
> $_SERVER["REQUEST_URI"] ?>">
> <p>Your Email* :</p>
> <input class="email-text-box" type="text" name="email">
> <p>Your Name* :</p>
> <input class="name-text-box" type="text" name="name"> <!-- Here
> name='name' forces wordpress to redirect to 404 page-->
> <input name="send" type="submit" value="Send">
> </form>
> }}}
>
> 2) Create a page & set it to this custom template.
> 3) Goto this page & Submit your value & it'll redirect you to 404 page.
> 4) Change
>
> {{{
> <input class="name-text-box" type="text" name="name">
> }}}
>
> to something else let's say
>
> {{{
> <input class="name-text-box" type="text" name="testusername">
> }}}
> Now it'll work properly.
>
> I'm not sure about reserved character, but i googled it & didn't find
> anything.
New description:
Hi,
I just noticed that there's a bug in wordpress template handling.
If we create a page & selected custom template in which a form submit is
written & uses 'name' as name in input field then it forces wordpress to
redirect to 404 page instead of template page itself.
{{{
<input class="username" type="text" name="name">
}}}
Step to create this bug:
1) Create a template & write form submit code in it.
{{{
<form name="myForm" method="post" action="<?php echo
$_SERVER["REQUEST_URI"] ?>">
<p>Your Email* :</p>
<input class="email-text-box" type="text" name="email">
<p>Your Name* :</p>
<input class="name-text-box" type="text" name="name"> <!-- Here
name='name' forces wordpress to redirect to 404 page-->
<input name="send" type="submit" value="Send">
</form>
}}}
2) Create a page & set it to this custom template.
3) Goto this page & Submit your value & it'll redirect you to 404 page.
4) Change
{{{
<input class="name-text-box" type="text" name="name">
}}}
to something else let's say
{{{
<input class="name-text-box" type="text" name="testusername">
}}}
Now it'll work properly.
I'm not sure about reserved character, but i googled it & didn't find
anything.
--
Comment:
`name` query var is a reserved term, as it's used internally by WordPress:
http://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27157#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list