File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -966,10 +966,11 @@ function syslog_install_advisor($syslog_exists) {
966966 $ type = __ ('Install ' , 'syslog ' );
967967 }
968968
969- $ database = db_fetch_row ('SHOW GLOBAL VARIABLES LIKE "version" ' );
969+ syslog_connect ();
970+ $ database = syslog_db_fetch_row ('SHOW GLOBAL VARIABLES LIKE "version" ' );
970971
971- /* remove Aria as a storage enging if this is mysql */
972- if (stripos ($ database ['Value ' ], 'mariadb ' ) == false ) {
972+ /* remove Aria as a storage engine if this is mysql */
973+ if (stripos ($ database ['Value ' ], 'mariadb ' ) === false ) {
973974 unset($ fields_syslog_update ['engine ' ]['array ' ]['aria ' ]);
974975 } else {
975976 $ fields_syslog_update ['engine ' ]['value ' ] = 'aria ' ;
@@ -1632,4 +1633,3 @@ function syslog_utilities_list() {
16321633 </tr>
16331634 <?php
16341635}
1635-
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ $ setup = file_get_contents (dirname (__DIR__ , 2 ) . '/setup.php ' );
4+
5+ if ($ setup === false ) {
6+ fwrite (STDERR , "Failed to load setup.php \n" );
7+ exit (1 );
8+ }
9+
10+ $ legacyPattern = '/stripos\s*\(\s*\$database\s*\[\s*[ \'"]{1}Value[ \'"]{1}\s*\]\s*,\s*[ \'"]{1}mariadb[ \'"]{1}\s*\)\s*==\s*false/ ' ;
11+ $ fixedPattern = '/stripos\s*\(\s*\$database\s*\[\s*[ \'"]{1}Value[ \'"]{1}\s*\]\s*,\s*[ \'"]{1}mariadb[ \'"]{1}\s*\)\s*===\s*false/ ' ;
12+
13+ if (preg_match ($ legacyPattern , $ setup )) {
14+ fwrite (STDERR , "Legacy loose MariaDB stripos comparison is still present. \n" );
15+ exit (1 );
16+ }
17+
18+ if (!preg_match ($ fixedPattern , $ setup )) {
19+ fwrite (STDERR , "Strict MariaDB stripos comparison is missing. \n" );
20+ exit (1 );
21+ }
22+
23+ echo "issue270_mariadb_detection_strict_test passed \n" ;
You can’t perform that action at this time.
0 commit comments