Jump to content

Please Test


bsmither

Recommended Posts

Would someone please test this:

<?php
ini_set('memory_limit', '256M'); // Platypus Suhosin limit is 256M
ini_set('max_execution_time', '60');
ini_set('error_log', 'error_log');
ini_set('log_errors', 'on');

$search_data['keywords'] = "+(*TESA31*) +(*TESA34*) +(*TESA35*)";
$words = preg_replace('/[^\p{Greek}a-zA-Z0-9\-\s]+/u', '', $search_data['keywords']);
var_dump($words);
?>

I am running PHP 7.4.3 (on Linux Mint 19.4 if that makes a difference).

The regex is supposed to not remove whitespace (among other things), but it is.

I get:

string 'TESA31TESA34TESA35' (length=18)

 

Link to comment
Share on other sites

The ini_set test didn't fix it, but this is a work-around:

$words = preg_replace('/[^ \p{Greek}a-zA-Z0-9\-]+/u', '', $search_data['keywords']);

One generally doesn't manage to input - other than spaces - whitespace in text entry fields. (Hopefully, the Sanitize class will catch that anyway.)

I think it's a moot point anyway because it seems the final search term in searchCatalogue()'s fulltext mode is unusable because a string has been built up using multiple search words, then only to be torn down on the next statement.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...