[MacOS Catalina 10.15.3,
Apache/2.4.43 (Unix) mod_fcgid/2.3.10-dev PHP/7.3.11 ,
MySQL (mysql Ver 14.14 Distrib 5.7.20, for macos10.12 (x86_64) using EditLine wrapper),
WikiNDX 6.3.7]
I'm not really good with BUG Reports, so any suggestions on how to improve my report are welcome.
This bug report has to do with pasting images directly into the text areas (I've been doing this with the abstract and note fields).
In PARSEPHRASE.php::createCondition, line 405, the line should be updated to:
$storedHighlight = array_filter(UTF8::mb_explode(',', $this->session->getVar("search_Highlight")));
Whereby array_filter
has been added to the existing code.
This is required because if search_Hightlight
is not set, $this->session->getVar("search_Highlight")
returns an array with element [0] equal to an empty string.
The next line merges $storedHighlight
with $searchHighlight
. Because $storedHighlight
has an empty string, this results in $storedHighlight
being set to ",SearchTerm"
which confuses further implode
statements because of the leading comma.
The array_filter
command (which can have a callback function defined) removes all entries/elements that evaluate to false; e.g. empty strings, null values, and boolean false values from the array.
The symptom of this problem is not noticed until you paste images into the text fields being searched. You will know when this occurs because Apache->php will go into an endless loop that requires Apache to be restarted. In order to trigger the problem outlined below, do the following:
Quick Search
say on the author, choose to view the resource.preg_replace
in RESOURCECOMMON.php::doHighlight, line 136.Filtering $storedHighlight
as indicated above fixes this problem.
Thanks Nap,
I'd say that's a pretty comprehensive bug report. I'll look into it today.
Regards,
Mark
Thanks Nap,
Fixed in SVN.
Mark