Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(installer): rare case where sql_version is not defined (#965) #966

Open
wants to merge 1 commit into
base: php81
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/configs/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.8.0",
"git": "1411",
"git": "1412",
"dev": true
}
45 changes: 23 additions & 22 deletions web/install/template/page.3.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
?>

<b><p>This page will list all of the requirements to run the SourceBans web interface, and compare them with your current values. This page will also list some recomendations. These aren't required to run SourceBans web interface, but they are highly recomended.</p></b>
<b><p>This page will list all of the requirements to run the SourceBans web interface, and compare them with your current values. This page will also list some recomendations. These aren't required to run SourceBans web interface, but they are highly recommended.</p></b>
<table style="width: 101%; margin: 0 0 -2px -2px;">
<tr>
<td colspan="3" class="listtable_top"><b>PHP Requirements</b></td>
Expand All @@ -25,7 +25,7 @@
<table width="98%" cellspacing="0" cellpadding="0" align="center" class="listtable" style="margin-top:3px;">
<tr>
<td width="33%" height="16" class="listtable_top">Setting</td>
<td width="22%" height="16" class="listtable_top">Recomended</td>
<td width="22%" height="16" class="listtable_top">Recommended</td>
<td width="22%" height="16" class="listtable_top">Required</td>
<td width="22%" height="16" class="listtable_top">Your Value</td>
</tr>
Expand Down Expand Up @@ -130,7 +130,7 @@
<table width="98%" cellspacing="0" cellpadding="0" align="center" class="listtable" style="margin-top:3px;">
<tr>
<td width="33%" height="16" class="listtable_top">Setting</td>
<td width="22%" height="16" class="listtable_top">Recomended</td>
<td width="22%" height="16" class="listtable_top">Recommended</td>
<td width="22%" height="16" class="listtable_top">Required</td>
<td width="22%" height="16" class="listtable_top">Your Value</td>
</tr>
Expand All @@ -139,28 +139,29 @@
<td width="22%" height="16" class="listtable_top">N/A</td>
<td width="22%" height="16" class="listtable_1"><b>Mysql 5.5 or MariaDB 10.0.5</b></td>
<?php
// Ensure $sql_version is defined
if (!isset($sql_version)) {
$sql_version = '0.0.0';
}

//our SQL is using FULLTEXT in inno DB.
//this is only supported from Mysql 5.5 onwards
//and >= MariaDB 10.0.5 ( https://mariadb.com/kb/en/full-text-index-overview/ )
if (strpos($sql_version, 'MARIADB') !== false){
//we have a mariadb.
//check for versions below 10.0.5
if(version_compare($sql_version, "10.0.5", "<")){
$class = "red";
$errors++;
}else{
$class = "green";
}
}else{
//other DB (presumably mysql)
//check for stuff lower then 5.5
if(version_compare($sql_version, "5.5", "<")) {
$class = "red";
$errors++;
}else{
$class = "green";
if (!empty($sql_version) && strpos($sql_version, 'MARIADB') !== false) {
if (version_compare($sql_version, '10.0.5') != -1) {
$class = "green";
} else {
$class = "red";
$errors++;
}
}
}
// other DB (presumably mysql) - check for stuff lower then 5.5
elseif (!empty($sql_version) && strpos($sql_version, '5.5') != -1 || strpos($sql_version, '10.0.5') != -1) {
$class = "green";
} else {
$class = "red";
$errors++;
}
?>
<td width="22%" height="16" class="<?php echo $class?>"><?php echo $sql_version;?></td>
</tr>
Expand All @@ -176,7 +177,7 @@
<table width="98%" cellspacing="0" cellpadding="0" align="center" class="listtable" style="margin-top:3px;">
<tr>
<td width="33%" height="16" class="listtable_top">Setting</td>
<td width="22%" height="16" class="listtable_top">Recomended</td>
<td width="22%" height="16" class="listtable_top">Recommended</td>
<td width="22%" height="16" class="listtable_top">Required</td>
<td width="22%" height="16" class="listtable_top">Your Value</td>
</tr>
Expand Down
Loading