PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Troubleshooting

Reply
 
Thread Tools
Old 10-23-2003, 11:52 PM   #1
uruloki
Green Mole
 
Join Date: Sep 2003
Posts: 6
Question Problems with html coments <!-- -->

When I index pages with html coments like

<!-- #begintemplate="algo" -->

the spider replace it with

< begintemplate algo >

and this is a problem because I have coments with paths to conexion entries for my DataBases
The regular expressions in robot functions that match with that kind of sentences is as it appears:

//f..k <!SOMETHING tags !!
$text = eregi_replace('(<)!([^-])','\1\2',$text);

Sorry for my english, thanks for suggestions.

BYE

<!-- #begintemplate="algo" -->
uruloki is offline   Reply With Quote
Old 10-24-2003, 01:47 AM   #2
Rolandks
Purple Mole
 
Rolandks's Avatar
 
Join Date: Sep 2003
Location: Kassel, Germany
Posts: 119
It is a problem with with > PHP 4.3.2 . The following must work as possible solution: See this thread here:

Change ONLY this in robot_functions.php Line 160:
Code:
//replace any group of blank characters by an unique space
$text = ereg_replace("[[:blank:]]+"," ",strip_tags($text));
to
Code:
//replace any group of blank characters by
$text = preg_replace('/<.*>/U', '', $text);
It works with PHP 4.3.2 and PhpDig 1.6.2.
NO html-comments are indexing !


-Roland-
Rolandks is offline   Reply With Quote
Old 10-24-2003, 05:40 AM   #3
uruloki
Green Mole
 
Join Date: Sep 2003
Posts: 6
What about that

The real problem I have is when I index an internet domain, the comments appear, and when I work with the intranet domain works well (no comment). We have PHP 4.3.2. I made that change in the order of eregi_replace in robot_functions.php.

BEFORE:
//replace blank characters by spaces
$text = eregi_replace("--|[{}();\"]+|</[a-z0-9]+>|[\r\n\t]+",' ',$text);

//f..k <!SOMETHING tags !!
$text = eregi_replace('(<)!([^-])','\1\2',$text);

AFTER:
//f..k <!SOMETHING tags !!
$text = eregi_replace('(<)!([^-])','\1\2',$text);

//replace blank characters by spaces
$text = eregi_replace("--|[{}();\"]+|</[a-z0-9]+>|[\r\n\t]+",' ',$text);

I test the change and seems to work fine. I will reindex all today and if results... I post another commentarie.

Again sorry for may english...
uruloki is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
<!-- phpdigInclude --> and <!-- phpdigExclude --> doesn`t work Paka76 How-to Forum 0 12-06-2005 06:44 AM
Indexing "<word>-<word>"? FaberFedor How-to Forum 23 02-28-2005 04:35 AM
Where have all the <titles> gone? siliconkibou Troubleshooting 8 08-27-2004 08:09 AM
Instructions for use <!-- phpdigExclude --> and <!-- phpdigInclude --> maquido How-to Forum 1 06-02-2004 04:36 AM
< phpdigInclude > oliviert Troubleshooting 12 05-19-2004 03:13 AM


All times are GMT -8. The time now is 10:21 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.