11
allnewtome
Re: ERRATUM
  • 2006/1/14 15:53

  • allnewtome

  • Not too shy to talk

  • Posts: 175

  • Since: 2005/11/30


As a beginner, I didn't quite understand this thread at first. Hopefully you won't mind me putting it into simple words!

On XOOPS 2.2.3 a dot appears after email addresses (e.g. in xfsection articles)

To get rid of this, go to the file class/module.textsanitizer.php

At line 131 you will see
function makeClickable( $text )
This is what converts the email address into a clickable link, and which also adds the offending dot.

Find the lines beginning
$replacements = array

Four lines after that you will see
host1+'.'+host2
twice in the same line.

Change both occurrences to
host1+''+host2
(i.e. remove the dot between the apostrophes)

This will remove the dot from both the email address as it displays on the screen, and as it comes up in Outlook.





The second improvement mentioned above was replacing @ with the code & # 6 4 (you need to remove the 3 spaces from between those 4 characters).

This is to help confuse spiders which crawl the internet collecting email addresses.

The @ symbol appears twice on the line which you've just amended. Just delete it and replace it with & # 6 4 each time.




As far as I know, the use of Javascript in XOOPS 2.2.3 to display the email links is itself a quite effective means to combat the email spiders.

I hope that removing the extra dot will lead to much more junk mail.



Hope this helps the beginners like myself!!

12
technigrafa
Re: ERRATUM

Maybe I'm not understanding this correctly, but I did the fix described here and indeed it got rid of the extra period at the end of email addresses. But even though there is a fancy javascript to make a spider safe mailto: link, the HTML version is still included right behind it--won't that still be spidered?

Here's an example, using XOOPS 2.2.3 and the content module, I put in an email address without making it a link. when I view the source of the page though I see this:

<script type="text/javascript">var id='user';var host1='domain.com';var host2='';document.write('<a href="mailto:'+id+'&#64'+host1+''+host2+'">'+id+'&#64'+host1+''+host2+'</a>');</script><a href="mailto:user@domain.com">user@domain.com</a>


What I see is there is STILL:
<a href="mailto:user@domain.com">user@domain.com</a>

showing up after the javascript. Is this safe?

13
allnewtome
Re: ERRATUM
  • 2006/1/14 18:06

  • allnewtome

  • Not too shy to talk

  • Posts: 175

  • Since: 2005/11/30


Maybe it's a problem with the content module? I don't have it. Does the same happen e.g. in a custom block?

Mine is the same as yours, EXCEPT for the
<a href="mailto:user@domain.com">user@domain.com</a>
at the end.

Could you cut&paste the contents of
function makeClickable( $text )
?

Maybe there's an extra bit at the end that shouldn't be there?

Sorry I can't give a definite answer - perhaps someone else can.

14
Tobias
Re: ERRATUM
  • 2006/1/15 5:44

  • Tobias

  • Not too shy to talk

  • Posts: 172

  • Since: 2005/9/13


Quote:
by technigrafa on 2006/1/14 12:54:05

Maybe I'm not understanding this correctly, but I did the fix described here and indeed it got rid of the extra period at the end of email addresses. But even though there is a fancy javascript to make a spider safe mailto: link, the HTML version is still included right behind it--won't that still be spidered?

Hmm, I may be wrong, but if I'm not, then what the javascript does is writing the mailto link into the source of the page that's eventually displayed by the browser. It tells the browser to amend the source before rendering it. Some browsers may actually show you the amended source from a temporary location if you hit "view source", others may show you the original version as served by the server. Don't know.
Now, if you want to see whether the hack works as intended, you can switch off javascript in your browser and reload the page. Then, it should not render the link, and it should also not drop the tag into the source. If it does, then the problem is, indeed, a problem.
www.affvu.org

15
allnewtome
Re: ERRATUM
  • 2006/1/15 11:46

  • allnewtome

  • Not too shy to talk

  • Posts: 175

  • Since: 2005/11/30


(EDIT: I originally posted about how it might be that the content module had it's own text sanitiser, but it's early in the morning and it didn't make much sense.....)

16
snakes
Re: ERRATUM
  • 2006/1/16 8:36

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


The dot at the end of the email is due to the replacements array.

Look at the end:
"\1<script language="javascript">var id='\2';var host1='\3';var host2='';document.write('<a href="mailto:'+id+'@'+host1+'.'+host2+'">'+id+'@'+host1+'.'+host2+'</a>');</script>"


You see that host2 is equal to '' (empty string)
Then href will contain host1+'.'+host2, but host2 is empty so the email will have the '.' at the end.

What we do is to replace that code with:
"\1<script language="javascript">var id='\2';var host1='\3';document.write('<a href="mailto:'+id+'@'+host1+'">'+id+'@'+host1+'</a>');</script>

17
technigrafa
Re: ERRATUM

Thanks for the help guys! Tobias, you were right! Turning off javascript keeps that HTML mailto from showing up, so I guess we're good to go. Why didn't I think of that!

Thanks again all!

18
technigrafa
Re: ERRATUM

Sorry for bringing this back from the dead, but I was checking out another site and noticed that even if I turn off javascript, the mailto: code is still there.

Did this get changed in a recent XOOPS update? I put an email address in as just text, no link, in the content module, and XOOPS converts it to a mailto: link. That used to happen, but when I turned off javascript, it didn't work, but now it still works without javascript/java on. Is is still safe from spam spiders?

Login

Who's Online

198 user(s) are online (129 user(s) are browsing Support Forums)


Members: 0


Guests: 198


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits