2023-09-05, 04:33 PM
Errors are generated in inc/functions_search.php on a fulltext search using default search parameters with a unique keyword.
Undefined variable $inquote
perform_search_mysql_ft() is called, and it appears $inquote is a local boolean variable, initialized in line 1479.
clean_keywords_ft() is called at line 1468 but there is no initialization of $inquote in that function.
clean_keywords_ft() is only called from one place.
Elsewhere $inquote is initialized as false, in functions perform_search_sql(), help_document_perform_search_mysql(), privatemessage_perform_search_mysql().
I can clear the warning by initializing $inquote in clean_keywords_ft() before line 358
Undefined variable $inquote
<error>
<dateline>1693907855</dateline>
<datetime>2023-09-05 09:57:35 UTC -0500</datetime>
<script>inc/functions_search.php</script>
<line>363</line>
<type>2</type>
<friendly_type>Warning</friendly_type>
<message>Undefined variable $inquote</message>
<back_trace>#0 errorHandler->error() called at [/inc/class_error.php:153]
#1 errorHandler->error_callback() called at [/inc/functions_search.php:363]
#2 clean_keywords_ft() called at [/inc/functions_search.php:1468]
#3 perform_search_mysql_ft() called at [/search.php:1599]
</back_trace>
</error>
<error>
<dateline>1693907855</dateline>
<datetime>2023-09-05 09:57:35 UTC -0500</datetime>
<script>inc/functions_search.php</script>
<line>381</line>
<type>2</type>
<friendly_type>Warning</friendly_type>
<message>Undefined variable $inquote</message>
<back_trace>#0 errorHandler->error() called at [/inc/class_error.php:153]
#1 errorHandler->error_callback() called at [/inc/functions_search.php:381]
#2 clean_keywords_ft() called at [/inc/functions_search.php:1468]
#3 perform_search_mysql_ft() called at [/search.php:1599]
</back_trace>
</error>
<error>
<dateline>1693907855</dateline>
<datetime>2023-09-05 09:57:35 UTC -0500</datetime>
<script>inc/functions_search.php</script>
<line>467</line>
<type>2</type>
<friendly_type>Warning</friendly_type>
<message>Undefined variable $inquote</message>
<back_trace>#0 errorHandler->error() called at [/inc/class_error.php:153]
#1 errorHandler->error_callback() called at [/inc/functions_search.php:467]
#2 clean_keywords_ft() called at [/inc/functions_search.php:1468]
#3 perform_search_mysql_ft() called at [/search.php:1599]
</back_trace>
</error>
perform_search_mysql_ft() is called, and it appears $inquote is a local boolean variable, initialized in line 1479.
clean_keywords_ft() is called at line 1468 but there is no initialization of $inquote in that function.
clean_keywords_ft() is only called from one place.
Elsewhere $inquote is initialized as false, in functions perform_search_sql(), help_document_perform_search_mysql(), privatemessage_perform_search_mysql().
I can clear the warning by initializing $inquote in clean_keywords_ft() before line 358
$inquote = false; // core edit, added
although it may be better placed elsewhere.