View Full Version : URL not showing correctly
lordmatrix
10-21-2009, 10:05 AM
all messages sent with Universal Email seems generating a wrong code when URL is present.
This is the email source code:
<p>lorem ipsum dolorem sit amet: <a
href=\"http://www.google.com\">Google</a></p>
And this is the content from database. (the same sent with UE)
<p>lorem ipsum dolorem sit amet: <a href="http://www.google.com">Google</a></p>
What could be the problem? I'm runnig Universal Email 306
Many thanks in advance.
neilo
10-21-2009, 03:17 PM
I am currently also having this problem while testing out the new HTML editor applied to a text area in a contact form solution pack form. Everything is default with no modifications.
I thought it might be an HTML editor glitch - but your post has reminded me that the HTML editor uses universal email to send the input. EDIT//
Eric Mittman
10-22-2009, 11:30 AM
In my testing that I did the links did not come out this way:
<p>lorem ipsum dolorem sit amet: <a
href=\"http://www.google.com\">Google</a></p>
When I check the source code of the UE page name WAUE_<page name>_1.php I can see that the slashes are present in the code. Please open this file and find the value in the body of the message and post back with this reference.
I'm thinking that there is some extra formatting occurring in regards to the display of this value, the extra formatting could result in having too many slashes. If you have a hard time identifying this value you can post back with the page in a zip archive so it can be examined, just let us know what recordset and column you are getting the value from.
lordmatrix
10-22-2009, 12:31 PM
Hello Eric, as stated in my first post, everything is correct, the email source code generates the wrong code not the page. As you see from my second code sample, the href tag is correct.
Did you also try sending you an email? Are you able to to click the link? I did try again today with a blank page, form applied and sending the email, once again, the link was not clickable since the generated code is wrong. Please let me know after testing this. It is most probably a bug on Universal Email.
Many thanks in advance.
neilo
10-22-2009, 05:45 PM
Hi Eric,
Just to confirm, - I still have this problem too; any link sent from this form by email to me comes out like:
/src/\"http://www.google.co.uk\" - if I access it in a POP3 mailbox,
or
\"http://www.google.co.uk\" when the link arrives in Outlook
Cheers
Edit:: PS - I could set the email address to someone at webassist on a sample form if it helped.
Eric Mittman
10-22-2009, 06:38 PM
If you have a test message like this you can send it to support.webassist@gmail.com. This is an unmonitored email box that I have access to so I can see what you send there.
What I would like to see is the value in the WAUE source files. What you see in your email message should relate directly to how it is coded in the source. In the source you want to have the slashes before the double quotes so that it gets written to a link properly.
When I tested this I have the slashes in my WAUE source code. When the link shows in the email I'm able to click on it and it works as expected, there are no extra slashes at this point. I ran this test before my first response.
neilo
10-22-2009, 08:14 PM
Thanks Eric,
I have temporarily set a test 'straight from the box' Contact Form SP (with HTML Editor applied) to send to the address you supplied, at:
http://www.yeractual.com/contact_styled.php
Hopefully you will see the errors that we are seeing, or perhaps even more hopefully, you won't. Either way, a step forward.
Attached zip of WAUE files
Regards
EDIT:: - Have just set up a HTML Editor form to email with same presets and link, and this (without using UE) sends link OK - so this absolves HTML Editor of contributary blame!
lordmatrix
10-23-2009, 02:10 AM
Eric, I just sent you an email to the email address specified using UE. Please let me know if you received it.
This issue is now becoming urgent for me, I would really appreciate a solution ASAP, if possible.
Many thanks in advance.
Edit: attached zip file with form and UE files used for testing.
Note: removed email address and server settings since we're on public forum, please see comments on code.
lordmatrix
10-23-2009, 04:54 AM
I ran this test before my first response.
Eric, did you just write an URL in the email or you tested writing the HTML code?
try sending the email with the following code in textarea and you will able to replicate the problem:
Click <a href="http://www.google.com">this link</a> to test.
Furthermore, if you just write text "wrapped with quotes" the email body will display \"wrapped with quotes\"
lordmatrix
10-23-2009, 05:44 AM
neilo, use the stripslashes() function, it works for me.
open WUAE_yourfile_1.php, at the bottom of the file, add the stripslashes() function. see the example below:
before:
$MailBody = $MailBody . ((isset($_POST["message"]))?$_POST["message"]:"");
after:
$MailBody = $MailBody . stripslashes((isset($_POST["message"]))?$_POST["message"]:"");
neilo
10-23-2009, 11:34 AM
Cheers Lordmatrix,
I don't have the exact line that you have ( $MailBody = $MailBody . ((isset($_POST["message"]))?$_POST["message"]:""); )
The lines that I have (at the bottom of WAUE_contact_1.php) are these:
//Start Mail Body
$MailBody = $MailBody . "";
ob_start();
require_once(dirname(__FILE__) . ("/Templates/contactus.php"));
$contents = ob_get_clean();
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . ($contents);
$MailBody = $MailBody . "";
//End Mail Body
Not sure where to place the stripslashes in these, (or even if I should have to; I would have expected the stripslashes function to be extant and functional as standard in the UE part of the Contact Form Solution Pack 'out of the box').
Thanks though!
lordmatrix
10-23-2009, 11:45 AM
I'm sure WebAssist will soon release an UniversalEmail update fixing this.
the stripslashes function should be in every line on $MailBody where you get data from your form fields/textareas.
In this example, I have a textarea named message
$MailBody = $MailBody . ((isset($_POST["message"]))?$_POST["message"]:"");
See the entire code below to get a better idea:
//Start Mail Body
$MailBody = $MailBody . "Title: ";
$MailBody = $MailBody . stripslashes((isset($_POST["title"]))?$_POST["title"]:"");
$MailBody = $MailBody . "<br />\r\n";
$MailBody = $MailBody . "<br />\r\n";
$MailBody = $MailBody . "Message:<br />\r\n";
$MailBody = $MailBody . stripslashes((isset($_POST["message"]))?$_POST["message"]:"");
$MailBody = $MailBody . "";
//End Mail Body
neilo
10-23-2009, 11:56 AM
Cheers again,
So my lines are:
$MailBody = $MailBody . "";
$MailBody = $MailBody . "\r\n";
$MailBody = $MailBody . ($contents);
$MailBody = $MailBody . "";
Does one put 'stripslashes' in all of these? Or just one? (Or none!)
neilo
10-23-2009, 11:57 AM
Ooooh - how do you do the code area (as you have in your post)? Always meant to ask someone!
lordmatrix
10-23-2009, 12:15 PM
could you please copy/paste here your /Templates/contactus.php file? The stripslashes function will not work if you add it before ($contents).
PS: to use the code in BBcode use this button in Advanced Editor http://www.webassist.com/forums/images/editor/code.gif or manually add the code tag
[ code ]
your code here...
[ /code ]
(remove the spaces) ;)
neilo
10-23-2009, 12:24 PM
Cheers lordmatrix, - thanks for all this!
The contactus code is:
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body style="font-family: Arial, Helvetica, sans-serif;">
<div id="content" style="font-size: 12px;">
<h1 style="color: #777890;font-size: 14px;font-weight: bold;margin:0;">Contact Form Response</h1>
<hr style="margin:0;"/>
<?php
foreach( $_POST as $pkey => $pval ){
if ($pval != "" && strpos($pkey,"Security_") !== 0 && $pkey != "x" && $pkey != "y") {
?>
<div style="formRow">
<strong><?php echo(str_replace("_"," ",$pkey)); ?>: </strong>
<?php echo(str_replace("\n","<BR />",$pval)); ?>
</div>
<?php
}
}
?>
</div>
</body>
</html>
neilo
neilo
10-23-2009, 12:53 PM
Hi Eric,
Did you get round to testing the links by sending a form to email as arranged in out posts #6 and #7 on this thread?
Cheers
Eric Mittman
10-23-2009, 01:49 PM
Neilo, I did not receive your test messages, only lordmatrix's messages came through. In these messages I can see the extra slashes.
It sounds like using the strip slashes should work, for you this would need to be implemented around the $pval like this:
<div style="formRow">
<strong><?php echo(str_replace("_"," ",$pkey)); ?>: </strong>
<?php echo(str_replace("\n","<BR />",stripslashes($pval))); ?>
</div>
Please give this a try and let us know if it works. Thanks to both of you for working on this so diligently. If both of you are able to confirm that added the strip slashes makes it work then I will look into getting a bug of some type logged for this so it can be updated.
neilo
10-23-2009, 02:10 PM
Eric
Thank you so much for this: - have tested it out and it is now working perfectly. That last code change did it!
Many thanks to you and lordmatrix for your time and patience with this.
neilo
lordmatrix
10-23-2009, 04:06 PM
If both of you are able to confirm that added the strip slashes makes it work then I will look into getting a bug of some type logged for this so it can be updated
Yes, the stripslashes function works for me.
Eric Mittman
10-23-2009, 05:24 PM
Thanks for the update, neilo, how did this work for you?
neilo
10-23-2009, 05:33 PM
Did the trick - cheers for the fix!
Eric Mittman
10-26-2009, 04:39 PM
Thanks to both of you for working through this. I have done some more testing on my end and can confirm that links sent to emails from my server do not have any problems with the slashes. I think this might be due to a PHP server setting, maybe the get magic quotes, but I'm not sure. Hopefully if others have this problem this thread will help them get to the solution.
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.