Search results corrupting URLs

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

wmcasey
Posts: 12
Joined: Mon Nov 17, 2003 7:32 pm

Search results corrupting URLs

Post by wmcasey »

We are having an odd problem.If I do a search and the results contain URLs, the link to the first article works correctly, however subsequent linkls to differnt articles have malformed URLs.
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

which version do you use? This should be fixed in 1.3.9

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
wmcasey
Posts: 12
Joined: Mon Nov 17, 2003 7:32 pm

Post by wmcasey »

DOH 1.3.6, I will run the upgrade, and try to make sure I dont mess up too many things!


thanks


Bill
wmcasey
Posts: 12
Joined: Mon Nov 17, 2003 7:32 pm

Post by wmcasey »

OK. I have upgraded the install to 1.3.9. (some nice imporvements)

However this error is still occuring, and seems to be directly related to the URL. If I remove the URL tags it occurs in the next article that has a URL tag, if I replace the url tag, it moves back to that article.


cheers


Bill
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

is it possible for you to show your FAQ with this bug?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
wmcasey
Posts: 12
Joined: Mon Nov 17, 2003 7:32 pm

Post by wmcasey »

OK....this machine is not on the net, but as messy as it is I will post the output from phpMyFaq and then a dump of 2 rows that are having this problem:

Code: Select all

<p><p>4 search results</p>
<ul type="square">
<li><b>Aboriginals</b>: <a href="/infosite/english/index.php?sid=aa99304d9ccb6dabb3e3620b1d278822&aktion=artikel&rubrik=001&id=17&lang=en&highlight=schedule">Aboriginal Peoples of Canada Adaptations Regu...</a><br><div style="font-size: 10px;"><b>Content: </b> The Firearms Act has regulations that apply particularly to Aboriginal peoples. ...</div><br></li>
<li><b>Application Forms</b>: <a href="/infosite/english/index.php?sid=aa99304d9ccb6dabb3e3620b1d278822&aktion=artikel&rubrik=006&id=34&lang=en&highlight=schedule">Form JUS 794E <span style="color: #FF0000; border: 1px dotted #FF0000;">Schedule</span> A
Declaration and con...</a><br><div style="font-size: 10px;"><b>Content: </b> To view form JUS 794E click on this link <a href="http://nbcpsw0998/infosite/for...</div><br></li>
<li><b>Application Forms</b>: <a href="/infosite/english/index.php?sid=aa99304d9ccb6dabb3e3620b1d278822&aktion=artikel&rubrik=006&id=33&lang=en&highlight=schedule">Form JUS 793E <span style="color: #FF0000; border: 1px dotted #FF0000;">Schedule</span> C
Application for alt...</a><br><div style="font-size: 10px;"><b>Content: </b> To view form JUS 793E click on this link <a href="http://nbcpsw0998/infosite/for...</div><br></li>
<li><b>Application Forms</b>: <a href="/infosite/english/index.php?sid=aa99304d9ccb6dabb3e3620b1d278822&aktion=artikel&rubrik=006&id=32&lang=en&highlight=schedule">Form JUS 792E <span style="color: #FF0000; border: 1px dotted #FF0000;">Schedule</span> B
Recommendation for ...</a><br><div style="font-size: 10px;"><b>Content: </b> To view form JUS 792E click on this link <a href="http://nbcpsw0998/infosite/for...</div><br></li>
</ul>
</p>


Code: Select all

# phpMyAdmin MySQL-Dump
# version 2.5.0
# http://www.phpmyadmin.net/ (download page)
#
# Host: localhost
# Generation Time: Dec 04, 2003 at 12:12 PM
# Server version: 3.23.56
# PHP Version: 4.3.0
# Database : `pub_infosite`
# --------------------------------------------------------

#
# Table structure for table `pubfaqdata`
#
# Creation: Dec 04, 2003 at 10:16 AM
# Last update: Dec 04, 2003 at 12:00 PM
# Last check: Dec 04, 2003 at 11:48 AM
#

CREATE TABLE `pubfaqdata` (
  `id` int(11) NOT NULL auto_increment,
  `lang` varchar(5) NOT NULL default '',
  `active` char(3) NOT NULL default '',
  `rubrik` text NOT NULL,
  `keywords` text NOT NULL,
  `thema` text NOT NULL,
  `content` text NOT NULL,
  `author` varchar(255) NOT NULL default '',
  `email` varchar(255) NOT NULL default '',
  `comment` enum('y','n') NOT NULL default 'y',
  `datum` varchar(15) NOT NULL default '',
  PRIMARY KEY  (`id`,`lang`),
  FULLTEXT KEY `keywords` (`keywords`,`thema`,`content`)
) TYPE=MyISAM AUTO_INCREMENT=54 ;

#
# Dumping data for table `pubfaqdata`
#

INSERT INTO `pubfaqdata` VALUES (34, 'en', 'yes', '006', 'schedule\r\naboriginal\r\ndeclaration\r\nindian\r\nmetis', 'Form JUS 794E Schedule A\r\nDeclaration and confirmation\r\n', 'To view form JUS 794E click on this link [url=http://nbcpsw0998/infosite/forms/794e.pdf ]http://nbcpsw0998/infosite/forms/794e.pdf [/url]', 'user1', 'user1@domain.ca', 'n', '20031204120017');
INSERT INTO `pubfaqdata` VALUES (35, 'en', 'yes', '006', 'Pain\r\nAgency\r\npublic', 'Form JUS 975E Application for a Public Agency Identification Number to the Registrar of Firearms', 'To view form JUS 975E click on this link [url=http://nbcpsw0998/infosite/forms/975.pdf]http://nbcpsw0998/infosite/forms/975.pdf[/url]', 'user1', 'user1@domain.ca', 'n', '20031204102341');
[/code]
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi Bill,

I found the problem: The links are cut in the middle of the HTML code and then there is only a mess. :(

I'll look for a solution to solve this problem.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
wmcasey
Posts: 12
Joined: Mon Nov 17, 2003 7:32 pm

Post by wmcasey »

I wonder if we just turn off the highlighting for the "content" if that will resolve this problem? Would I just need to remove something from the SeachEngine function?



Bill
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi Bill,

this would solve the problem. Just remove this from functions.php in the function searchEngine():

Code: Select all

$thema = preg_replace('/(((href|src)="[^"]*)?'.$begriff.'(?(1).*"))/umies', "highlight_no_links(\"\\1\")", $thema);
			$content = preg_replace('/(((href|src)="[^"]*)?'.$begriff.'(?(1).*"))/umies', "highlight_no_links(\"\\1\")", $content);
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
wmcasey
Posts: 12
Joined: Mon Nov 17, 2003 7:32 pm

Post by wmcasey »

Well....it was worth a try ;)

The URLs are still getting becoming corrupted.
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi Bill,

sorry, I just forgot something.

Delete this part in artikel.php:

Code: Select all

if (isset($_REQUEST["highlight"]) && $_REQUEST["highlight"] != "/" && $_REQUEST["highlight"] != "<" && $_REQUEST["highlight"] != ">") {
    $highlight = $_REQUEST["highlight"];
    $highlight = str_replace("/", "\/", $highlight);
    $content = preg_replace('/(((href|src)="[^"]*)?'.$highlight.'(?(1).*"))/umies', "highlight_no_links(\"\\1\")", $content);
	}
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

this issue will be handled better in phpMyFAQ 1.4.0 M2.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
wmcasey
Posts: 12
Joined: Mon Nov 17, 2003 7:32 pm

Post by wmcasey »

This seems to have "mostly" fixed it. Still a couple causing trouble. I will try to see if there is something in common with them.



Bill
Thorsten
Posts: 15724
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi Bill,

I will backport it to 1.3.9 next week or just mail me.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
AndrewB
Posts: 171
Joined: Fri Aug 22, 2003 11:15 pm
Contact:

Post by AndrewB »

I have problems when the search word is in the title (I think that is the cause?)

http://www.myie2info.com/faq/plugininde ... f=download
Post Reply