Skip to content

Commit 78433ef

Browse files
fix: address TheWitness review feedback on PR Cacti#290
- Remove redundant locales/index.php and locales/LC_MESSAGES/index.php - Revert database.php optional null param (single connection per script) - Replace json_encode with __esc() for JS string output in setup.php Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
1 parent c72b93b commit 78433ef

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

database.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,9 @@ function syslog_db_fetch_assoc_prepared($sql, $params = array(), $log = TRUE) {
174174
*
175175
* @return the id of the last auto incriment row that was created
176176
*/
177-
function syslog_db_fetch_insert_id($syslog_cnn = null) {
178-
if ($syslog_cnn === null) {
179-
global $syslog_cnn;
180-
}
181-
182-
return db_fetch_insert_id($syslog_cnn);
177+
function syslog_db_fetch_insert_id() {
178+
global $syslog_cnn;
179+
return db_fetch_insert_id($syslog_cnn);
183180
}
184181

185182
/**

locales/LC_MESSAGES/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@
2323
*/
2424

2525
header('Location:../index.php');
26-
exit;
2726

locales/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@
2323
*/
2424

2525
header('Location:../index.php');
26-
exit;
2726

setup.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,21 +1652,21 @@ function syslog_utilities_list() {
16521652
$(function() {
16531653
$('#syslog_purge_hosts').on('click', function() {
16541654
$('#syslog_purge_dialog').dialog({
1655-
title: <?php print json_encode(__('Confirm Purge', 'syslog'), JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT);?>,
1655+
title: <?php print "'" . __esc('Confirm Purge', 'syslog') . "'";?>,
16561656
minHeight: 80,
16571657
minWidth: 400,
16581658
resizable: false,
16591659
draggable: true,
16601660
buttons: {
16611661
'Cancel': {
1662-
text: <?php print json_encode(__('Cancel', 'syslog'), JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT);?>,
1662+
text: <?php print "'" . __esc('Cancel', 'syslog') . "'";?>,
16631663
id: 'btnPurgeCancel',
16641664
click: function() {
16651665
$(this).dialog('close');
16661666
}
16671667
},
16681668
'Continue': {
1669-
text: <?php print json_encode(__('Continue', 'syslog'), JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT);?>,
1669+
text: <?php print "'" . __esc('Continue', 'syslog') . "'";?>,
16701670
id: 'btnPurgeContinue',
16711671
click: function() {
16721672
$(this).dialog('close');

0 commit comments

Comments
 (0)