Start enforcing PHP and SQL version limitations.

This commit is contained in:
Brian Huisman 2023-06-26 15:00:42 -04:00
parent 5a39280858
commit 30630c6c60
2 changed files with 10 additions and 10 deletions

View file

@ -8,8 +8,8 @@ require __DIR__.'/config.ini.php';
// Check PHP version compatibility
if (PHP_VERSION_ID < 70200)
throw new Exception('Orcinus Site Search requires PHP version ">= 7.2.0". You are running '.PHP_VERSION.'.');
if (PHP_VERSION_ID < 80000)
throw new Exception('Orcinus Site Search requires PHP version ">= 8.0.x". You are running '.PHP_VERSION.'.');
// ***** Connect to the database
@ -35,13 +35,13 @@ $_DDATA['version'] = $version[0]['sql_version'];
// Check Database version compatibility
if (preg_match('/^(\d+)\.(\d+)\.(\d+)-?(.*)$/', $_DDATA['version'], $ver)) {
// if (strpos($ver[4], 'MariaDB') === 0) {
// if ((int)$ver[1] < 10 || (int)$ver[3] < 5)
// throw new Exception('Orcinus Site Search requires MariaDB version ">= 10.0.5". You are running '.$_DDATA['version'].'.');
// } else {
// if ((int)$ver[1] < 8 || (int)$ver[3] < 17)
// throw new Exception('Orcinus Site Search requires MySQL version ">= 8.0.17". You are running '.$_DDATA['version'].'.');
// }
if (strpos($ver[4], 'MariaDB') === 0) {
if ((int)$ver[1] < 10 || (!(int)$ver[2] && (int)$ver[3] < 5))
throw new Exception('Orcinus Site Search requires MariaDB version ">= 10.0.5". You are running '.$_DDATA['version'].'.');
} else {
if ((int)$ver[1] < 8 || (!(int)$ver[2] && (int)$ver[3] < 17))
throw new Exception('Orcinus Site Search requires MySQL version ">= 8.0.17". You are running '.$_DDATA['version'].'.');
}
}

View file

@ -1399,7 +1399,7 @@ while ($_cURL && count($_RDATA['sp_queue'])) {
$data['content'] = str_replace(array("\\\n\r", "\\\n"), '', $data['content']);
$data['info']['charset'] = mb_detect_encoding($data['content']);
if (!$data['info']['charset']) $data['info']['charset'] = 'ISO-8859-1';
if (!$data['info']['charset']) $data['info']['charset'] = 'CP1252';
OS_cleanTextUTF8($data['content'], $data['info']['charset']);
if ($data['content']) {