In the Divi 4.9.10 the respective line number to patch is 1913.
How to implement FullTextSearch on a page?
-
@EpsilonAdmin Attached is a screen cap of one of the documents. The full link for this document is:
https://staging4.hamlinny.org/documents/assessors-office/assessment-rolls/2019/2019-Final-Roll.pdf
If you go to my documents page here:
[https://staging4.hamlinny.org/document-center/](link url)
and search for the word "Sewer" (without the quotes), this document will be the first one in the search results. Note that the link for the title is correct, while the URL for the Download link is incorrect.
-
Okay, Larry,
please could you go to the code we added last time and replace 6th line from the end:
$a['link'] = '<a target="_blank" class="wpfts-download-link'.$shift.'" href="'.esc_url($link).'"><span>'.__('Download', 'fulltext-search').'</span></a>';
by this one:
$a['link'] = '<a target="_blank" class="wpfts-download-link'.$shift.'" href="'.htmlspecialchars($link).'"><span>'.__('Download', 'fulltext-search').'</span></a>';
(actually only
esc_url
has been replaced byhtmlspecialchars
).I think this function breaks the URL somehow on your server (and it's VERY strange).
Please let me know. Thanks!
-
@EpsilonAdmin I replaced esc_url with htmlspecialchars, but that didn't fix the issue. Very strange, indeed.
You can see when you mouseover the Download link that the url is incorrect, right? But the link on the title is correct!
-
@sanfordandson Could there be something in the .htaccess file that is causing this?
-
I don't think so, it looks like a PHP problem.
Which version of the Document Library Pro you are using?
-
@EpsilonAdmin 1.7.2 (current version)
-
@sanfordandson I know it's a cludge, but could you strip out all occurrences of "https//"? That would make the url correct.
-
Okay, Larry
I am sure they made some tricks in the plugin to modify URL, but I can't say which tricks, since I only have version 1.1.2 at the moment.
So let's go with the "patch" solution. Please replace the line
$a['link'] = '<a target="_blank" class="wpfts-download-link'.$shift.'" href="'.htmlspecialchars($link).'"><span>'.__('Download', 'fulltext-search').'</span></a>';
with this one
$a['link'] = '<a target="_blank" class="wpfts-download-link'.$shift.'" href="'.htmlspecialchars(preg_replace('~^\/\/http~', 'http', $link)).'"><span>'.__('Download', 'fulltext-search').'</span></a>';
It should work.
-
@EpsilonAdmin Wow, still didn't work. I even deleted the astra theme's functions.php file from the server, refreshed the browser (it blew up, as expected), then uploaded the modified functions.php file. I did all this to make sure there was no cache issue. Still doesn't work. Real bizarre.
Would it help if I sent you login credentials and ftp credentials via email?
-
Hi, Larry
This would be great, so I can check by myself.
BTW I see a strange error in search results page.Unfortunately I gonna go right now and will be back in some hours to check WP admin. Please send me access to email.
Thanks!
-
@EpsilonAdmin Will do.
-
Hi, Larry
The problem with the links has been fixed - just a typo in the code. The code in the messages above is correct.