Skip to content

Commit 26af20c

Browse files
committed
More security issues
1 parent e781ae6 commit 26af20c

File tree

6 files changed

+20
-13
lines changed

6 files changed

+20
-13
lines changed

admin/partials/_bmlt_server_setup.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<label for="sslverify"><?php esc_html_e('Disable SSL verification of server', 'bread') ?></label>
3232
<?php }
3333
} elseif ($this->bread->emptyOption('root_server')) {
34-
echo "<span style='color: #f00;'><div style='font-size: 16px;vertical-align: middle;' class='dashicons dashicons-dismiss'></div>".__('ERROR: Please enter a BMLT Server', 'bread')."</span>";
34+
echo "<span style='color: #f00;'><div style='font-size: 16px;vertical-align: middle;' class='dashicons dashicons-dismiss'></div>".esc_html(__('ERROR: Please enter a BMLT Server', 'bread'))."</span>";
3535
echo '<input type="hidden" id="user_agent" value="' . esc_html($this->bread->getOption('user_agent')) . '" />';
3636
if ($this->bread->getOption('sslverify') == '1') { ?>
3737
<p>
@@ -70,7 +70,10 @@
7070
<div id="customquery-tooltip-content">
7171
<p>
7272
<?php esc_html_e('This will be executed as part of the meeting search query. This will override any setting in the Service Body dropdowns.', 'bread') ?>
73-
<br /><?php echo sprintf(__('You can get help formulating a query using your sites <a href="%s">semantic interface</a>.', 'bread'), esc_url($this->bread->getOption('root_server')).'/semantic') ?>
73+
/* translators: draft saved date format, see http://php.net/date */
74+
<br /><?php
75+
/* translators: the string is a link to the semantic interface of the BMLT server */
76+
echo esc_html(sprintf(__('You can get help formulating a query using your sites <a href="%s">semantic interface</a>.', 'bread'), esc_url($this->bread->getOption('root_server'))).'/semantic') ?>
7477
</p>
7578
</div>
7679
</div>

admin/partials/_custom_section_setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div id="normal-sortables" class="meta-box-sortables ui-sortable">
88
<div id="custom-content-div" class="postbox">
99
<div style="display:none;">
10-
<div id="customsection-tooltip-content"><?php echo wp_filter_post_kses(__("
10+
<div id="customsection-tooltip-content"><?php echo wp_kses_post(__("
1111
<p>The Custom Content can be customized with text, graphics, tables, shortcodes, etc.</p>
1212
<p><strong>Default Font Size</strong> can be changed for specific text in the editor.</p>
1313
<p><strong>Add Media</strong> button - upload and add graphics.</p>

admin/partials/_front_page_setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div id="normal-sortables" class="meta-box-sortables ui-sortable">
88
<div id="frontpagecontentdiv" class="postbox">
99
<div style="display:none;">
10-
<div id="frontpage-tooltip-content"><?php echo wp_filter_post_kses(__("
10+
<div id="frontpage-tooltip-content"><?php echo wp_kses_post(__("
1111
<p>The Front Page can be customized with text, graphics, tables, shortcodes, ect.</p>
1212
<p><strong>Add Media</strong> button - upload and add graphics.</p>
1313
<p><strong>Meeting List Shortcodes</strong> dropdown - insert custom data.</p>

admin/partials/_meetings_setup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,9 @@
336336
<select id="additional_list_language" name="additional_list_language">
337337
<?php
338338
if ($this->bread->getOption('additional_list_language') == '') {
339-
echo "<option value=\"\" selected=\"selected\">".__('Same as main list', 'bread')."</option>";
339+
echo "<option value=\"\" selected=\"selected\">".esc_html(__('Same as main list', 'bread'))."</option>";
340340
} else {
341-
echo "<option value=\"\">".__('Same as main list', 'bread')."</option>";
341+
echo "<option value=\"\">".esc_html(__('Same as main list', 'bread'))."</option>";
342342
}
343343
foreach ($this->bread->getTranslateTable() as $key => $value) {
344344
if ($this->bread->getOption('additional_list_language') == $key) {

admin/partials/bread-admin-display.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,17 @@ private function refresh_status()
3636
if ($serverInfo[0]["aggregator_mode_enabled"] ?? false) {
3737
$this->server_version = "<span style='color: #00AD00;'><div style='font-size: 16px;vertical-align: middle;' class='dashicons dashicons-admin-site'></div>".__('Using Tomato Server', 'bread')."</span>";
3838
} elseif ($this->connected) {
39+
/* translators: string is the version number of the BMLT Server */
3940
$this->server_version = "<span style='color: #0A8ADD;'><div style='font-size: 16px;vertical-align: middle;' class='dashicons dashicons-smiley'></div>".sprintf(__('Your BMLT Server is running %s', 'bread'), esc_html($this->connected)). "</span>";
4041
}
4142
}
4243
}
4344
private function select_service_bodies()
4445
{
4546
for ($i = 1; $i <= 5; $i++) { ?>
46-
<li><label for="service_body_<?php echo esc_html($i); ?>"><?php echo sprintf(__('Service Body %s', 'bread'), esc_html($i)) ?>: </label>
47+
<li><label for="service_body_<?php
48+
/* translators: Bread can query up to five servers, the string is the number 1-5 */
49+
echo esc_html($i); ?>"><?php echo esc_html(sprintf(__('Service Body %s', 'bread'), $i)) ?>: </label>
4750
<select class="service_body_select" id="service_body_<?php echo esc_html($i); ?>" name="service_body_<?php echo esc_html($i); ?>"><?php
4851
if ($this->connected) {
4952
$this->select_service_body_options($i);
@@ -90,16 +93,17 @@ function admin_options_page()
9093
set_transient('admin_notice', 'Please put down your weapon. You have 20 seconds to comply.');
9194
echo '<div class="updated">';
9295
if (!$this->admin->current_user_can_modify()) {
93-
echo '<p style="color: #F00;">'.__('You do not have permission to save this configuation!', 'bread').'</p>';
96+
echo '<p style="color: #F00;">'.esc_html(__('You do not have permission to save this configuation!', 'bread')).'</p>';
9497
} elseif (isset($_COOKIE['bread_import_file'])) {
95-
echo '<p style="color: #F00;">'.__('File loaded', 'bread').'</p>';
98+
echo '<p style="color: #F00;">'.esc_html(__('File loaded', 'bread')).'</p>';
9699
delete_transient($this->bread->get_TransientKey($this->bread->getRequestedSetting()));
97100
} elseif (isset($_POST['bmltmeetinglistsave']) && $_POST['bmltmeetinglistsave']) {
98101
$this->admin->save_admin_options();
99-
echo '<p style="color: #F00;">'.__('Your changes were successfully saved!', 'bread').'</p>';
102+
echo '<p style="color: #F00;">'.esc_html(__('Your changes were successfully saved!', 'bread')).'</p>';
100103
$num = delete_transient($this->bread->get_TransientKey($this->bread->getRequestedSetting()));
101104
if ($num > 0) {
102-
echo "<p>" . sprintf(__('%s Cache entries deleted', 'bread'), esc_attr($num))."</p>";
105+
/* translators: string is number of cache entries deleted */
106+
echo "<p>" . esc_html(sprintf(__('%s Cache entries deleted', 'bread')), esc_attr($num))."</p>";
103107
}
104108
}
105109
echo '</div>';

includes/class-bread-i18n.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ class Bread_i18n
3535
*/
3636
public function load_plugin_textdomain()
3737
{
38-
38+
/*
3939
load_plugin_textdomain(
4040
'bread',
4141
false,
4242
dirname(dirname(plugin_basename(__FILE__))) . '/languages/'
43-
);
43+
); */
4444
}
4545
}

0 commit comments

Comments
 (0)