Search changes link

Please report bugs here!

Moderator: Thorsten

Post Reply
dcgibs
Posts: 10
Joined: Mon Jun 26, 2006 8:41 pm
Location: St. Louis, Missouri

Search changes link

Post by dcgibs »

When a search is done on my site for an attached file, it highlights the word but changes the link and puts quotes around the filepath.

without the highlight my link would be
http://server_name/docs/attachments/#id/testing.doc

with the highlighted word in the link, it changes to this
http://server_name/"attachments/#id/testing.doc"

how do i fix this?
Thorsten
Posts: 15723
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

we'll check this.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
dcgibs
Posts: 10
Joined: Mon Jun 26, 2006 8:41 pm
Location: St. Louis, Missouri

Post by dcgibs »

I have temporary edited out the highlight section in artikel.php.

Code: Select all

#if (isset($_GET["highlight"]) && $_GET["highlight"] != "/" && $_GET["highlight"] != "<" && $_GET["highlight"] != ">") {
#    $highlight = strip_tags($_GET["highlight"]);
#    $highlight = str_replace("'", "´", $highlight);
#    $highlight = preg_quote($highlight, '/');
#    $content = preg_replace('/(((href|src)="[^"]*)?'.$highlight.'(?(1).*"))/mies', "highlight_no_links('\\1')", $content);
#}
The search still works fine and the link is working now when searched for but of course, the highlighting is gone. The highlighting is a really nice touch and I would like to get it working soon.

I really enjoy phpmyfaq. Thanks
Last edited by dcgibs on Tue Jun 27, 2006 7:17 pm, edited 1 time in total.
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Re: Search changes link

Post by matteo »

Hi,
dcgibs wrote:When a search is done on my site for an attached file, it highlights the word but changes the link and puts quotes around the filepath.

without the highlight my link would be
http://server_name/docs/attachments/#id/testing.doc

with the highlighted word in the link, it changes to this
http://server_name/"attachments/#id/testing.doc"
I've just tested your post as the faq content into PMF 1.6.2 and then I've searched for the word "attach", find below the result:

Code: Select all

...
<a href="http://server_name/docs/attachments/#id/testing.doc" title="Test the Issue">http://<span style="font-style: italic;">server_name</span>/docs/<span class="highlight">attach</span>ments/#id/testing.doc</a>
...
As you can see, there is no break of the href attribute.
Could you kindly post:
  1. your PMF version;
  2. a copy (please use

    Code: Select all

     tag) of your faq content: you could obfuscate the original test 'cause I'm only in need of your faq HTML structure;[*]the word(s) used for performing the search[/list]?
    TIA,
    Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
dcgibs
Posts: 10
Joined: Mon Jun 26, 2006 8:41 pm
Location: St. Louis, Missouri

Post by dcgibs »

$PMF_CONF["version"] = "1.5.0 RC6"

when searching for testing

Code: Select all

<h2>testing</h2>
    <!-- Article -->
    <p><p>attached files: <a href=\"attachments/429/testing.doc" target="_blank"><span class="highlight">testing</span>.doc</a></p></p>
    <!-- /Article -->
    <p>Last update: 2006-06-27 12:59<br />Author: Administrator</p>
navigating directly to testing yields this

Code: Select all

<h2>testing</h2>
    <!-- Article -->
    <p><p>attached files: <a href="attachments/429/testing.doc" target="_blank">testing.doc</a></p></p>
    <!-- /Article -->
    <p>Last update: 2006-06-27 12:59<br />Author: Administrator</p>
I see the break, but I can't figure out where this is happening.
Thorsten
Posts: 15723
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

this was fixed during one of the 1.5.x releases.... you should upgrade to 1.5.9 or 1.6.2 as soon as possible due to security issues, too!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
dcgibs
Posts: 10
Joined: Mon Jun 26, 2006 8:41 pm
Location: St. Louis, Missouri

Post by dcgibs »

danke, good to know then.

gibby
dcgibs
Posts: 10
Joined: Mon Jun 26, 2006 8:41 pm
Location: St. Louis, Missouri

upgrade complete

Post by dcgibs »

i upgraded to 1.6.3 and the search works great. thanks.
Post Reply