1.0.12 - Email Cloaking bug?

Locked
AlCher
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Mon Sep 19, 2005 8:33 am

1.0.12 - Email Cloaking bug?

Post by AlCher » Mon Feb 19, 2007 1:13 pm

Forms of sending messages from a site do not work, if in a html-code of the form there is an expression, for example:



and mambot Email Cloaking it is published.

There "email@myemail.com" it is replaced Javascript code and the form does not work.

If mambot Email Cloaking unpublish, all OK.

Whether it is possible mambot Email Cloaking unpublish for separate pages, no for a site in whole?
{mosemailcloak=off} or {mosemailcloak=no}email addreass{/mosemailcloak} do not work.

Sorry for my poor English.

User avatar
johnjames84
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Wed Dec 13, 2006 9:13 am
Contact:

Re: 1.0.12 - Email Cloaking bug?

Post by johnjames84 » Mon May 07, 2007 12:12 pm

To solve the Email cloaking issue in the joomla I replaced the regular expression of  "$search_email" in the mambots=>content=>mosemailcloak.php. The details are as follows:

    * Default regular expression in CMS: $search_email = "([[:alnum:]_\.\-]+)(\@[[:alnum:]\.\-]+\.+)([[:alnum:]\.\-]+)";
    * Modified regular expression: $search_email = "^[\_\-\.[:alnum:]]+\@[[:alnum:]\-]+(\.[a-z]{2,5})";

Hope this would help many. Comments welcome


James  NT
Webmaster, Joomla Brothers
http://www.joomlabrothers.com

AlCher
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Mon Sep 19, 2005 8:33 am

Re: 1.0.12 - Email Cloaking bug?

Post by AlCher » Thu May 10, 2007 8:29 am

Thanks, yours hack works for e-mail in fields of the form.
But for e-mail in the contents, there is incorrect.

Compare:

It without your hack - the code in html:


' );
document.write( addy_text17472 );
document.write( '' );
//-->\n


It with your hack:


' );
document.write( addy_text202 );
document.write( '' );
//-->\n


var addy_text202 = 'sales@infosoft.ru'; - that is incorrect.

It would be desirable to learn opinion of developers Joomla.

User avatar
johnjames84
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Wed Dec 13, 2006 9:13 am
Contact:

Re: 1.0.12 - Email Cloaking bug?

Post by johnjames84 » Wed May 16, 2007 10:53 am

Thanks Alcher For bringing me the bug!!
This bug is nomore.

Follow the procedure:
1. Replace the regular expression :        $search_email= "(^[\_\-\.[:alnum:]]+)(\@[[:alnum:]\-]+)(\.[a-z]{2,5})";
2. Replace the '0' by '1' in $replacement = mosHTML::emailCloaking( $mail, $mode, $mail_text, 1 );

in mosemailcloak.php. In the block

    // search for derivativs of link code anytext
$pattern = botMosEmailCloak_searchPattern( $search_email_msg, $search_text );
while( eregi( $pattern, $row->text, $regs ) ) {

$mail = $regs[2] . $regs[3] . $regs[4] . $regs[5];
$mail_text = $regs[6];
//needed for handling of Body parameter
$mail = str_replace( '&', '&', $mail );
$replacement = mosHTML::emailCloaking( $mail, $mode, $mail_text, 1 );
// replace the found address with the js cloacked email
$row->text    = str_replace( $regs[0], $replacement, $row->text );
}

3. Include the following lines
    if($text_parts[0]!=""){
$replacement .= "\n var addy_text". $rand ." = '". @$text[0] ."' + '@' + '". implode( "' + '.' + '", @$text_parts ) ."';";
}
else{
$replacement .= "\n var addy_text". $rand ." = '". @$text[0] . implode( "' + '.' + '", @$text_parts ) ."';";
}


in this block in includes/joomla.php

if ( $email ) {
// convert text
$text = mosHTML::encoding_converter( $text );
// split email by @ symbol
$text = explode( '@', $text );
$text_parts = explode( '.', $text[1] );
if($text_parts[0]!=""){
$replacement .= "\n var addy_text". $rand ." = '". @$text[0] ."' + '@' + '". implode( "' +            '.' + '", @$text_parts ) ."';";
}
else{
$replacement .= "\n var addy_text". $rand ." = '". @$text[0] . implode( "' + '.' + '", @$text_parts ) ."';";
  }

} else {
$replacement .= "\n var addy_text". $rand ." = '". $text ."';";

I hope this will solve all the issues. If you still find any problems let me know.


Thanks
James
Last edited by johnjames84 on Wed May 16, 2007 10:58 am, edited 1 time in total.
Webmaster, Joomla Brothers
http://www.joomlabrothers.com

AlCher
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Mon Sep 19, 2005 8:33 am

Re: 1.0.12 - Email Cloaking bug?

Post by AlCher » Fri May 18, 2007 9:14 am

James, thank you very much.

I tested yours huck.

Huck works for:
// search for derivativs of link code email@amail.com
// search for derivativs of link code anytext

Unfortunately, huck does not work for:
// search for derivativs of link code anytext
These e-mail are not processed JavaScript.

By respect, Alexander

User avatar
johnjames84
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Wed Dec 13, 2006 9:13 am
Contact:

Re: 1.0.12 - Email Cloaking bug?

Post by johnjames84 » Fri May 18, 2007 10:05 am

Change the "0" parameter to "1"
$replacement = mosHTML::emailCloaking( $mail, $mode, $mail_text, 1 );

in the block

// search for derivativs of link code anytext
$pattern = botMosEmailCloak_searchPattern( $search_email, $search_text );
while( eregi( $pattern, $row->text, $regs ) ) {
$mail = $regs[2] . $regs[3] . $regs[4];
$mail_text = $regs[5];

$replacement = mosHTML::emailCloaking( $mail, $mode, $mail_text, 1 );

// replace the found address with the js cloacked email
$row->text = str_replace( $regs[0], $replacement, $row->text );
}

in mambots/content/mosemailcloak.php

Note:
1. When you try to view the source of the page please wait till the page gets loded fully.
2. Dont select the particular email id and then right-click and view the source.
3. Right-click in the page at some place after the page gets full loaded and view the source.

I hope its solved. Further queries please give me the link of your webpage.

Thanks
James NT
Last edited by johnjames84 on Fri May 18, 2007 10:08 am, edited 1 time in total.
Webmaster, Joomla Brothers
http://www.joomlabrothers.com

walquis
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Jun 28, 2006 1:23 am

Re: 1.0.12 - Email Cloaking bug?

Post by walquis » Fri Nov 09, 2007 2:24 am

James, thanks so much, this is the gift that keeps on giving.  I'm running 1.0.9, and your fixes did the trick.

Thanks again!
-chris walquist

AlCher
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Mon Sep 19, 2005 8:33 am

Re: 1.0.12 - Email Cloaking bug?

Post by AlCher » Thu Nov 15, 2007 2:19 pm

Finally, I used {emailcloak=off} + solution http://forum.joomla.org/index.php/topic ... msg1052163


Locked

Return to “Joomla! 1.0.x_Q&T”