mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 08:40:24 +00:00
Fix escaping data for new collapse UI widget
This commit is contained in:
@@ -85,7 +85,8 @@ if ($r == 0) {
|
||||
print &ui_details({
|
||||
'title' => $text{'syslog_desc2'},
|
||||
'content' => &text('index_emsg',"<tt>$rout</tt>"),
|
||||
'class' =>'error'});
|
||||
'class' =>'error',
|
||||
'html' => 1}, 1);
|
||||
}
|
||||
|
||||
if ($access{'stop'} && &is_mysql_local()) {
|
||||
@@ -109,7 +110,7 @@ elsif ($r == -1) {
|
||||
'title' => $text{'syslog_desc2'},
|
||||
'content' => &text('index_emsg',"<tt>$rout</tt>"),
|
||||
'class' => 'error',
|
||||
'open' => 'open'}) . "<br>";
|
||||
'html' => 1}, 1) . "<br>";
|
||||
}
|
||||
|
||||
print &ui_form_start("login.cgi", "post");
|
||||
|
||||
15
ui-lib.pl
15
ui-lib.pl
@@ -2723,7 +2723,7 @@ if (defined(&theme_ui_line_break_double)) {
|
||||
return "<br><br data-x-br>\n";
|
||||
}
|
||||
|
||||
=head2 ui_details(title, content, class)
|
||||
=head2 ui_details(Config, Opened)
|
||||
|
||||
Creates a disclosure widget in which information is visible only when
|
||||
the widget is toggled into an "open" state.
|
||||
@@ -2731,16 +2731,21 @@ the widget is toggled into an "open" state.
|
||||
=cut
|
||||
sub ui_details
|
||||
{
|
||||
my ($c) = @_;
|
||||
my ($c, $o) = @_;
|
||||
if (defined(&theme_ui_details)) {
|
||||
return &theme_ui_details(@_);
|
||||
}
|
||||
|
||||
my $rv;
|
||||
$c->{'class'} = "class=\"$c->{'class'}\"" if($c->{'class'});
|
||||
$rv = "<details $c->{'class'} $c->{'open'}>";
|
||||
if (!$c->{'html'}) {
|
||||
$c->{'title'} = &html_escape($c->{'title'});
|
||||
$c->{'content'} = &html_escape($c->{'content'});
|
||||
}
|
||||
$c->{'class'} = " class=\"@{["e_escape($c->{'class'})]}\"" if($c->{'class'});
|
||||
$o = ' open' if ($o);
|
||||
$rv = "<details$c->{'class'}$o>";
|
||||
$rv .= "<summary>$c->{'title'}</summary>";
|
||||
$rv .= "$c->{'content'}";
|
||||
$rv .= "<span>$c->{'content'}</span>";
|
||||
$rv .= "</details>";
|
||||
return $rv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user