File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,8 @@ function write_config($data)
118118 $ database_file = file_get_contents ($ template_path );
119119
120120 // Sanitize DB Password from single quotes
121- $ sanitized_db_pwd = preg_replace ("/\'/i " ,'\\\'' ,$ data ['db_password ' ]);
121+ $ sanitized_db_pwd = preg_replace ("/ \\\\/i " ,'\\\\\\\\' ,$ data ['db_password ' ]); // Escape the Escape char ( '\' becomes '\\' )
122+ $ sanitized_db_pwd = preg_replace ("/\'/i " ,'\\\\\'' ,$ sanitized_db_pwd ); // Escape the ' ( ' becomes \' )
122123
123124 $ new = str_replace ("%HOSTNAME% " , $ data ['db_hostname ' ], $ database_file );
124125 $ new = str_replace ("%USERNAME% " , $ data ['db_username ' ], $ new );
Original file line number Diff line number Diff line change @@ -1108,12 +1108,6 @@ function db_connection_test() {
11081108 return;
11091109 }
11101110
1111- if (db_hostname.includes('\\') || db_username.includes('\\') || db_password.includes('\\') || db_name.includes('\\')) {
1112- $('#db_connection_testresult').addClass('alert-danger');
1113- $('#db_connection_testresult').html('Error: Input cannot contain a backslash (\\).');
1114- return;
1115- }
1116-
11171111 var originalButtonText = $('#db_connection_test_button').html();
11181112 $('#db_connection_test_button').html('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Connecting...').prop('disabled', true);
11191113
@@ -1468,4 +1462,4 @@ function prevTab() {
14681462
14691463<?php endif ; ?>
14701464
1471- </html>
1465+ </html>
You can’t perform that action at this time.
0 commit comments