Opensearch Config error - phpMyFAQ from 2.0.12~2.6.2

Please report bugs here!

Moderator: Thorsten

Post Reply
fisher
Posts: 2
Joined: Sun Mar 07, 2010 1:07 pm

Opensearch Config error - phpMyFAQ from 2.0.12~2.6.2

Post by fisher »

I Find out that the phpMyFAQ's opensearch configuration code is error .

Code: Select all

<link rel="search" type="application/opensearchdescription+xml" title="TONTEC 知识库/问答中心" href="/search.html" />
search.html is not the valid format of opensearch xml, but the opensearch.php is the correct file:

Code: Select all

view-source:http://kb.tontec.cn/opensearch.php
/index.php

Code: Select all

if ($faqconfig->get('main.enableRewriteRules')) {
    $links_template_vars = array(
        "faqHome"             => $faqconfig->get('main.referenceURL'),
        "msgSearch"           => '<a href="' . $systemUri . 'search.html">'.$PMF_LANG["msgAdvancedSearch"].'</a>',
        'msgAddContent'       => '<a href="' . $systemUri . 'addcontent.html">'.$PMF_LANG["msgAddContent"].'</a>',
        "msgQuestion"         => '<a href="' . $systemUri . 'ask.html">'.$PMF_LANG["msgQuestion"].'</a>',
        "msgOpenQuestions"    => '<a href="' . $systemUri . 'open.html">'.$PMF_LANG["msgOpenQuestions"].'</a>',
        'msgHelp'             => '<a href="' . $systemUri . 'help.html">'.$PMF_LANG["msgHelp"].'</a>',
        "msgContact"          => '<a href="' . $systemUri . 'contact.html">'.$PMF_LANG["msgContact"].'</a>',
        "backToHome"          => '<a href="' . $systemUri . 'index.html">'.$PMF_LANG["msgHome"].'</a>',
        "allCategories"       => '<a href="' . $systemUri . 'showcat.html">'.$PMF_LANG["msgShowAllCategories"].'</a>',
        'showInstantResponse' => '<a href="' . $systemUri . 'instantresponse.html">'.$PMF_LANG['msgInstantResponse'].'</a>',
        'showSitemap'         => '<a href="' . $systemUri . 'sitemap/A/'.$LANGCODE.'.html">'.$PMF_LANG['msgSitemap'].'</a>',
        'opensearch'          => $systemUri . 'search.html');
} else {
    $links_template_vars = array(
        "faqHome"             => $faqconfig->get('main.referenceURL'),
        "msgSearch"           => '<a href="index.php?'.$sids.'action=search">'.$PMF_LANG["msgAdvancedSearch"].'</a>',
        "msgAddContent"       => '<a href="index.php?'.$sids.'action=add">'.$PMF_LANG["msgAddContent"].'</a>',
        "msgQuestion"         => '<a href="index.php?'.$sids.'action=ask">'.$PMF_LANG["msgQuestion"].'</a>',
        "msgOpenQuestions"    => '<a href="index.php?'.$sids.'action=open">'.$PMF_LANG["msgOpenQuestions"].'</a>',
        "msgHelp"             => '<a href="index.php?'.$sids.'action=help">'.$PMF_LANG["msgHelp"].'</a>',
        "msgContact"          => '<a href="index.php?'.$sids.'action=contact">'.$PMF_LANG["msgContact"].'</a>',
        "allCategories"       => '<a href="index.php?'.$sids.'action=show">'.$PMF_LANG["msgShowAllCategories"].'</a>',
        "backToHome"          => '<a href="index.php?'.$sids.'">'.$PMF_LANG["msgHome"].'</a>',
        'showInstantResponse' => '<a href="index.php?'.$sids.'action=instantresponse">'.$PMF_LANG['msgInstantResponse'].'</a>',
        'showSitemap'         => '<a href="index.php?'.$sids.'action=sitemap&lang='.$LANGCODE.'">'.$PMF_LANG['msgSitemap'].'</a>',
        'opensearch'          => '?'.$sids.'action=search');
}
Image
Image

This opensearch code should be modified to

Code: Select all

if ($faqconfig->get('main.enableRewriteRules')) {
    $links_template_vars = array(
...
'opensearch'            => $systemUri .'opensearch.html');
} else {
    $links_template_vars = array(
...
'opensearch'            => $systemUri .'opensearch.php';
}
.htaccess file:

Code: Select all

# the open search page
RewriteCond %{REQUEST_URI}          opensearch\.html$ [NC]
RewriteRule ^(.*)$                  opensearch.php [L,QSA]
-END-
fisher
Posts: 2
Joined: Sun Mar 07, 2010 1:07 pm

Re: Opensearch Config error - phpMyFAQ from 2.0.12~2.6.2

Post by fisher »

/opensearch.php

Code: Select all

$opensearch     = "<?xml version=\"1.0\" encoding=\"".$PMF_LANG['metaCharset']."\"?>
should be:

Code: Select all

$opensearch     = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Opensearch Config error - phpMyFAQ from 2.0.12~2.6.2

Post by Thorsten »

Hi,

thanks for the hint, it was partly already fixed in 2.6.3. Your patch will be included in 2.6.4.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply