links not parsing properly

All about webserver configurations, PHP and databases.

Moderator: Thorsten

cweeks
Posts: 3
Joined: Mon Dec 18, 2006 6:41 pm

URL

Post by cweeks »

Here is where our FAQ site is being hosted:

http://www.digitalscout.com/techsupport/

Note: on the 'Ask Question' line it reads:

Are you experiencing an issue that is not answered within the FAQ`

It should be:

Are you experiencing an issue that is not answered within the FAQ?

Thanks,

Chris
cweeks
Posts: 3
Joined: Mon Dec 18, 2006 6:41 pm

Upgrade to 1.6.8

Post by cweeks »

I have upgraded to 1.6.8 and it appears that the issue has been resolved. I am still testing - but it did take out the backticks (`) and has the proper question marks.

Chris
Joeydood
Posts: 43
Joined: Wed Nov 15, 2006 4:18 pm

Post by Joeydood »

from index.php:

Code: Select all

if (isset($PMF_CONF["mod_rewrite"]) && $PMF_CONF["mod_rewrite"] == "TRUE") {
    $links_template_vars = array(
                "faqHome" => $_SERVER['PHP_SELF'],
                "msgSearch" => '<a href="search.html">'.$PMF_LANG['msgAdvancedSearch'].'</a>',
				"msgAddContent" => '<a href="addcontent.html">'.$PMF_LANG["msgAddContent"].'</a>',
				"msgQuestion" => '<a href="ask.html">'.$PMF_LANG["msgQuestion"].'</a>',
				"msgOpenQuestions" => '<a href="open.html">'.$PMF_LANG["msgOpenQuestions"].'</a>',
				"msgHelp" => '<a href="help.html">'.$PMF_LANG["msgHelp"].'</a>',
				"msgContact" => '<a href="contact.html">'.$PMF_LANG["msgContact"].'</a>',
				"backToHome" => '<a href="index.html">'.$PMF_LANG["msgHome"].'</a>',
                "allCategories" => '<a href="showcat.html">'.$PMF_LANG["msgShowAllCategories"].'</a>',
				"writeSendAdress" => 'search.html',
                'showSitemap' => '<a href="sitemap-A_'.$lang.'.html">'.$PMF_LANG['msgSitemap'].'</a>');
} else {
    $links_template_vars = array(
                "faqHome" => $_SERVER['PHP_SELF'],
				"msgSearch" => '<a href="'.$_SERVER['PHP_SELF'].'?'.$sids.'action=search">'.$PMF_LANG['msgAdvancedSearch'].'</a>',
				"msgAddContent" => '<a href="'.$_SERVER['PHP_SELF'].'?'.$sids.'action=add">'.$PMF_LANG["msgAddContent"].'</a>',
				"msgQuestion" => '<a href="'.$_SERVER['PHP_SELF'].'?'.$sids.'action=ask">'.$PMF_LANG["msgQuestion"].'</a>',
				"msgOpenQuestions" => '<a href="'.$_SERVER['PHP_SELF'].'?'.$sids.'action=open">'.$PMF_LANG["msgOpenQuestions"].'</a>',
				"msgHelp" => '<a href="'.$_SERVER['PHP_SELF'].'?'.$sids.'action=help">'.$PMF_LANG["msgHelp"].'</a>',
				"msgContact" => '<a href="'.$_SERVER['PHP_SELF'].'?'.$sids.'action=contact">'.$PMF_LANG["msgContact"].'</a>',
                "allCategories" => '<a href="'.$_SERVER['PHP_SELF'].'?'.$sids.'action=show">'.$PMF_LANG["msgShowAllCategories"].'</a>',
				"backToHome" => '<a href="'.$_SERVER['PHP_SELF'].'?'.$sids.'">'.$PMF_LANG["msgHome"].'</a>',
				"writeSendAdress" => $_SERVER['PHP_SELF']."?".$sids."action=search",
                'showSitemap' => '<a href="'.$_SERVER['PHP_SELF'].'?'.$sids.'action=sitemap">'.$PMF_LANG['msgSitemap'].'</a>');
}
Joeydood
Posts: 43
Joined: Wed Nov 15, 2006 4:18 pm

Post by Joeydood »

this was in my parser.php file. please explain...

Code: Select all

        // Hack: Backtick Fix
        $myTemplate = str_replace('`', '?', $myTemplate);
Joeydood
Posts: 43
Joined: Wed Nov 15, 2006 4:18 pm

Post by Joeydood »

here's the fix (wasn't me!)...

change the previous line in your parser.php to this:

Code: Select all

        // Hack: Backtick Fix
        $tmp = str_replace('&acute;', '`', $tmp);
Joeydood
Posts: 43
Joined: Wed Nov 15, 2006 4:18 pm

Post by Joeydood »

although 'fixed', i'd like a developer-explanation of how and why since this is ORIGINAL code which i had to modify to fix this issue.
Joeydood
Posts: 43
Joined: Wed Nov 15, 2006 4:18 pm

Post by Joeydood »

with all things remaining the same, i would imagine the only thing which could have effected the situation would be changes to the FAQ site via the control panel since that was original source code which had to be modified.

but the question is - what option(s) could have caused the parser to fail???
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
Joeydood wrote:although 'fixed', i'd like a developer-explanation of how and why since this is ORIGINAL code which i had to modify to fix this issue.
first of all, the original code is:

Code: Select all

...
        // Hack: Backtick Fix
        $myTemplate = str_replace('`', '&acute;', $myTemplate);
...
;)

The explanation is probably related to the way you upload the files on your server: there's something that alter some chars e.g. '`' becomes ? as the result of an uncorrect encoding matching. Could you disclose any info about how you are deploying PMF on your server? I guess you're not uploading the files through FTP or your client, when choosing ASCII, tries to apply an encoding conversion which fails on some files.

Hope this help,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Joeydood
Posts: 43
Joined: Wed Nov 15, 2006 4:18 pm

Post by Joeydood »

hmmm...

regardless of the upload method, the site was working fine for weeks and there were no files uploaded recently to cause this issue to come about.
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
I'm waiting for a reply of the other user having the same issue to find out a reasonable answer. At the moment I can only guess that the issue is strictly related to some actions performed on the server by physical actors and these actions have no link with PMF and its code. Do you agree?

Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Joeydood
Posts: 43
Joined: Wed Nov 15, 2006 4:18 pm

Post by Joeydood »

i tend to want to agree with that statement.

if the code never changed then of course other factors could play a part in the failure.
Post Reply