You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Patrick Tully <pt...@avatartechnology.com> on 2002/03/04 22:49:15 UTC

processing = signs in input

Hi,
I'm using embperl 2.0 b5
Not sure if this is a bug or what, but it never seemed to occor in 1.x
releases.  It seems that entering a '=' inside an input item screws up %fdat
when processed.
Example:

<form method="POST" name="todo">
<input type="text" name="test">test=4</input>
</form>

------ die Dumper %fdat results:--------------------
[27155]ERR: 24: Error in Perl code: $VAR1 = 'message_subject test';
    $VAR2 = '4';


------- shouldn't it be:-----------------------------
$VAR1='message_subject';
$VAR2='4';

So $fdat{message_subject} seems to be undefined.  Is this a bug?  Please let
me know if you have any ideas.  Again, this didn't seem to occor in previous
1.x releases.  Thanks,

-Patrick Tully-


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: processing = signs in input

Posted by Patrick Tully <pt...@avatartechnology.com>.
whoops.... It looks like an error on our side.  I found a module that was
doing some waky stuff to are POST data.  Thanks for you help.

-Pat-

-----Original Message-----
From: Patrick Tully [mailto:ptully@avatartechnology.com]
Sent: Thursday, March 21, 2002 5:24 PM
To: embperl
Cc: Alex Schmelkin
Subject: RE: processing = signs in input


Hi, sorry its been a while since i last replyed to this thread.  I actually
found that this occurs ONLY if you POST the data.  So a GET request works
ok.  Here is the data dump from the code you gave me (slightly modified
because it has to be valid xsl):

GET Request (correct):
[19102]ERR: 24: Error in Perl code: $VAR1 = 'message_html';
    $VAR2 = ' Hello <font size="3">there</font>. This is html.';

POST Request (incorrect):
[18184]ERR: 24: Error in Perl code: $VAR1 = 'message_html Hello <font size';
    $VAR2 = '"3">there</font>. This is html.';

here is the modified code:
-EMPERL-----------------------------------

[-
use Data::Dumper;
 die Dumper %fdat if(defined(%fdat));
-]

<?xml version='1.0' encoding='utf-8' ?>
<page name="test.epl">
<fdat>
[$ while (($k, $v) = each %fdat) $]
    [+ "key = $k" +]|
    [+ "val = $v" +]|
[$endwhile$]
</fdat>
</page>

-XSL-------(CHANGE FORM METHOD GET/POST)------------------------------------
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#160;">]>
<xsl:stylesheet version="1.0" exclude-result-prefixes="duop"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:\
duop="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="page" name="test.epl">
<html>
  <title><xsl:value-of select="@title"/></title>
<body>
  <form method="GET">

    <table>
      <tr>
        <td><textarea name="message_html" rows="10" cols="70">
        Hello <font size="3">there</font>. This is html.</textarea></td><td>
<font color="red"></font></td>
      </tr>
      <tr>
        <td><textarea name="message_html2" rows="10"
cols="70"></textarea></td><td><font color="red"></font></td>
      </tr>
    </table>

    <input type="submit"/>
    <hr/>
    <xsl:value-of disable-output-escaping="yes" select="fdat"/>

 </form>

</body>
</html>

</xsl:template>

</xsl:stylesheet>




-----Original Message-----
From: Gerald Richter [mailto:richter@ecos.de]
Sent: Friday, March 08, 2002 1:36 AM
To: ptully@avatartechnology.com; embperl
Subject: Re: processing = signs in input




> Sorry, it should have been test.  So heres the real code snipets:
>

I have tried this, but it doesn't fails for me. I append you my test script.
Please run it as it is, when you press the submit button, you should see the
result at the top of the page. Does it come out right? If not, please send
me the output.

If it does come out right, try to modify it until you see the same error as
in your code.

Gerald

BTW. You shouldn't do the following (also it works most times):

> <textarea name="message_html" rows="" cols="">Hello <font>there</font>.
> This is html.</textarea>

Instead you have to escape the < and >, like

> <textarea name="message_html" rows="" cols="">Hello
&lt;font&gt;there&gt;/font&gt,.
> This is html.</textarea>

When you don't have change the escape mode, Embperl will do this for you,
for any output you insert in the page

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: processing = signs in input

Posted by Patrick Tully <pt...@avatartechnology.com>.
Hi, sorry its been a while since i last replyed to this thread.  I actually
found that this occurs ONLY if you POST the data.  So a GET request works
ok.  Here is the data dump from the code you gave me (slightly modified
because it has to be valid xsl):

GET Request (correct):
[19102]ERR: 24: Error in Perl code: $VAR1 = 'message_html';
    $VAR2 = ' Hello <font size="3">there</font>. This is html.';

POST Request (incorrect):
[18184]ERR: 24: Error in Perl code: $VAR1 = 'message_html Hello <font size';
    $VAR2 = '"3">there</font>. This is html.';

here is the modified code:
-EMPERL-----------------------------------

[-
use Data::Dumper;
 die Dumper %fdat if(defined(%fdat));
-]

<?xml version='1.0' encoding='utf-8' ?>
<page name="test.epl">
<fdat>
[$ while (($k, $v) = each %fdat) $]
    [+ "key = $k" +]|
    [+ "val = $v" +]|
[$endwhile$]
</fdat>
</page>

-XSL-------(CHANGE FORM METHOD GET/POST)------------------------------------
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#160;">]>
<xsl:stylesheet version="1.0" exclude-result-prefixes="duop"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:\
duop="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="page" name="test.epl">
<html>
  <title><xsl:value-of select="@title"/></title>
<body>
  <form method="GET">

    <table>
      <tr>
        <td><textarea name="message_html" rows="10" cols="70">
        Hello <font size="3">there</font>. This is html.</textarea></td><td>
<font color="red"></font></td>
      </tr>
      <tr>
        <td><textarea name="message_html2" rows="10"
cols="70"></textarea></td><td><font color="red"></font></td>
      </tr>
    </table>

    <input type="submit"/>
    <hr/>
    <xsl:value-of disable-output-escaping="yes" select="fdat"/>

 </form>

</body>
</html>

</xsl:template>

</xsl:stylesheet>




-----Original Message-----
From: Gerald Richter [mailto:richter@ecos.de]
Sent: Friday, March 08, 2002 1:36 AM
To: ptully@avatartechnology.com; embperl
Subject: Re: processing = signs in input




> Sorry, it should have been test.  So heres the real code snipets:
>

I have tried this, but it doesn't fails for me. I append you my test script.
Please run it as it is, when you press the submit button, you should see the
result at the top of the page. Does it come out right? If not, please send
me the output.

If it does come out right, try to modify it until you see the same error as
in your code.

Gerald

BTW. You shouldn't do the following (also it works most times):

> <textarea name="message_html" rows="" cols="">Hello <font>there</font>.
> This is html.</textarea>

Instead you have to escape the < and >, like

> <textarea name="message_html" rows="" cols="">Hello
&lt;font&gt;there&gt;/font&gt,.
> This is html.</textarea>

When you don't have change the escape mode, Embperl will do this for you,
for any output you insert in the page

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: processing = signs in input

Posted by Gerald Richter <ri...@ecos.de>.

> Sorry, it should have been test.  So heres the real code snipets:
>

I have tried this, but it doesn't fails for me. I append you my test script.
Please run it as it is, when you press the submit button, you should see the
result at the top of the page. Does it come out right? If not, please send
me the output.

If it does come out right, try to modify it until you see the same error as
in your code.

Gerald

BTW. You shouldn't do the following (also it works most times):

> <textarea name="message_html" rows="" cols="">Hello <font>there</font>.
> This is html.</textarea>

Instead you have to escape the < and >, like

> <textarea name="message_html" rows="" cols="">Hello
&lt;font&gt;there&gt;/font&gt,.
> This is html.</textarea>

When you don't have change the escape mode, Embperl will do this for you,
for any output you insert in the page

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------


RE: processing = signs in input

Posted by Patrick Tully <pt...@avatartechnology.com>.
Any more ideas on what could be going on here?  Thanks,

-Pat-

-----Original Message-----
From: Patrick Tully [mailto:ptully@avatartechnology.com]
Sent: Tuesday, March 05, 2002 11:09 AM
To: Gerald Richter; embperl
Subject: RE: processing = signs in input


Sorry, it should have been test.  So heres the real code snipets:

---------WORKS-----------------------------
HTML:
<td><textarea name="message_html" rows="" cols="">Hello <font>there</font>.
This is html.</textarea></td><td><font color="red"></font></td>
</tr>
</table>

SUBMIT - EMBPERL PROCESS-------------------
...
 ### PROCESS FORM
 if($fdat{save} == 1){
     die Dumper %fdat;
...

SCREEN RESULTS------------------------------
[27335]ERR: 24: Error in Perl code: $VAR1 = 'message_subject';
    $VAR2 = 'testing';
    $VAR3 = 'id';
    $VAR4 = '4';
    $VAR5 = 'save';
    $VAR6 = '1';
    $VAR7 = 'message_plain';
    $VAR8 = 'hello. This is text';
    $VAR9 = 'message_name';
    $VAR10 = 'test';
    $VAR11 = 'message_html';
    $VAR12 = 'Hello <font>there</font>. This is html.';
    $VAR13 = 'message_template_ind';
    $VAR14 = '1';
(looks good)

------DOES NOT WORK---------------------------------
HTML:
...
<td><textarea name="message_html" rows="" cols="">Hello <font
size="3">there</font>. This is html.</textarea></td><td><font
color="red"></font></td>
</tr>
</table>
...
SUBMIT - EMBPERL PROCESS-------------------
...
 ### PROCESS FORM
 if($fdat{save} == 1){
     die Dumper %fdat;
...

SCREEN RESULTS------------------------------
[27333]ERR: 24: Error in Perl code: $VAR1 = 'message_subject';
    $VAR2 = 'testing';
    $VAR3 = 'message_html Hello <font size';
    $VAR4 = '"3">there</font>. This is html.';
    $VAR5 = 'id';
    $VAR6 = '4';
    $VAR7 = 'save';
    $VAR8 = '1';
    $VAR9 = 'message_plain';
    $VAR10 = 'hello. This is text';
    $VAR11 = 'message_name';
    $VAR12 = 'test';
    $VAR13 = 'message_template_ind';
    $VAR14 = '1';

---END-------------------------------------------------
so i'm guessing its the equals sign.  I also tried putting an equal sign in
other html input types such as a text with similar results.  I also tried it
w/o the quotes around the '3' and got back similar results.  Is there maybe
a setting i have to set or something?  Seemed strange.  Let me know if you
need any more info.  Thanks,


-Patrick Tully-




-----Original Message-----
From: Gerald Richter [mailto:richter@ecos.de]
Sent: Tuesday, March 05, 2002 10:52 AM
To: ptully@avatartechnology.com; embperl
Subject: Re: processing = signs in input


> It seems that entering a '=' inside an input item screws up %fdat
> when processed.

I don't have this problem here. Entering a = works as expected.

> Example:
>
> <form method="POST" name="todo">
> <input type="text" name="test">test=4</input>

Here is no message_subject, should the name of the input be message_subject
?


Do you have small example script that produces the error? If yes please send
it to me

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: processing = signs in input

Posted by Patrick Tully <pt...@avatartechnology.com>.
Sorry, it should have been test.  So heres the real code snipets:

---------WORKS-----------------------------
HTML:
<td><textarea name="message_html" rows="" cols="">Hello <font>there</font>.
This is html.</textarea></td><td><font color="red"></font></td>
</tr>
</table>

SUBMIT - EMBPERL PROCESS-------------------
...
 ### PROCESS FORM
 if($fdat{save} == 1){
     die Dumper %fdat;
...

SCREEN RESULTS------------------------------
[27335]ERR: 24: Error in Perl code: $VAR1 = 'message_subject';
    $VAR2 = 'testing';
    $VAR3 = 'id';
    $VAR4 = '4';
    $VAR5 = 'save';
    $VAR6 = '1';
    $VAR7 = 'message_plain';
    $VAR8 = 'hello. This is text';
    $VAR9 = 'message_name';
    $VAR10 = 'test';
    $VAR11 = 'message_html';
    $VAR12 = 'Hello <font>there</font>. This is html.';
    $VAR13 = 'message_template_ind';
    $VAR14 = '1';
(looks good)

------DOES NOT WORK---------------------------------
HTML:
...
<td><textarea name="message_html" rows="" cols="">Hello <font
size="3">there</font>. This is html.</textarea></td><td><font
color="red"></font></td>
</tr>
</table>
...
SUBMIT - EMBPERL PROCESS-------------------
...
 ### PROCESS FORM
 if($fdat{save} == 1){
     die Dumper %fdat;
...

SCREEN RESULTS------------------------------
[27333]ERR: 24: Error in Perl code: $VAR1 = 'message_subject';
    $VAR2 = 'testing';
    $VAR3 = 'message_html Hello <font size';
    $VAR4 = '"3">there</font>. This is html.';
    $VAR5 = 'id';
    $VAR6 = '4';
    $VAR7 = 'save';
    $VAR8 = '1';
    $VAR9 = 'message_plain';
    $VAR10 = 'hello. This is text';
    $VAR11 = 'message_name';
    $VAR12 = 'test';
    $VAR13 = 'message_template_ind';
    $VAR14 = '1';

---END-------------------------------------------------
so i'm guessing its the equals sign.  I also tried putting an equal sign in
other html input types such as a text with similar results.  I also tried it
w/o the quotes around the '3' and got back similar results.  Is there maybe
a setting i have to set or something?  Seemed strange.  Let me know if you
need any more info.  Thanks,


-Patrick Tully-




-----Original Message-----
From: Gerald Richter [mailto:richter@ecos.de]
Sent: Tuesday, March 05, 2002 10:52 AM
To: ptully@avatartechnology.com; embperl
Subject: Re: processing = signs in input


> It seems that entering a '=' inside an input item screws up %fdat
> when processed.

I don't have this problem here. Entering a = works as expected.

> Example:
>
> <form method="POST" name="todo">
> <input type="text" name="test">test=4</input>

Here is no message_subject, should the name of the input be message_subject
?


Do you have small example script that produces the error? If yes please send
it to me

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: processing = signs in input

Posted by Gerald Richter <ri...@ecos.de>.
> It seems that entering a '=' inside an input item screws up %fdat
> when processed.

I don't have this problem here. Entering a = works as expected.

> Example:
>
> <form method="POST" name="todo">
> <input type="text" name="test">test=4</input>

Here is no message_subject, should the name of the input be message_subject
?


Do you have small example script that produces the error? If yes please send
it to me

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org