Skip to content

Commit

Permalink
webui: quote strings with slashes in job index and details view
Browse files Browse the repository at this point in the history
Strings coming from "translate" function can contain apostrophes
that need to be escaped.

(cherry picked from commit d72df73)

Fixes #1235: Special characters not escaped in translations
  • Loading branch information
gnieark authored and fbergkemper committed Aug 3, 2021
1 parent 77ae1e6 commit d29b16d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions webui/module/Job/view/job/job/details.phtml
Expand Up @@ -148,23 +148,23 @@ $this->headTitle($title);
html.push('<div class="container-fluid">');
html.push('<table class="table table-bordered">');
html.push('<tr>');
html.push('<th><?php echo $this->translate("Fileset"); ?></th>');
html.push('<th><?php echo addslashes($this->translate("Fileset")); ?></th>');
html.push('<td><a href="<?php echo $this->basePath() . '/fileset/details/'; ?>' + row.filesetid + '">' + row.fileset +'</a></td>');
html.push('</tr>');
html.push('<tr>');
html.push('<th><?php echo $this->translate("Pool"); ?></th>');
html.push('<th><?php echo addslashes($this->translate("Pool")); ?></th>');
html.push('<td><a href="<?php echo $this->basePath() . '/pool/details/'; ?>' + row.poolname + '">' + row.poolname + '</a></td>');
html.push('</tr>');
html.push('<tr>');
html.push('<th><?php echo $this->translate("Scheduled"); ?></th>');
html.push('<th><?php echo addslashes($this->translate("Scheduled")); ?></th>');
html.push('<td>' + row.schedtime + '</td>');
html.push('</tr>');
html.push('<tr>');
html.push('<th><?php echo $this->translate("Start"); ?></th>');
html.push('<th><?php echo addslashes($this->translate("Start")); ?></th>');
html.push('<td>' + row.starttime + '</td>');
html.push('</tr>');
html.push('<tr>');
html.push('<th><?php echo $this->translate("End"); ?></th>');
html.push('<th><?php echo addslashes($this->translate("End")); ?></th>');
html.push('<td>' + row.endtime + '</td>');
html.push('</tr>');
html.push('</table>');
Expand Down
6 changes: 3 additions & 3 deletions webui/module/Job/view/job/job/index.phtml
Expand Up @@ -149,15 +149,15 @@ $this->headTitle($title);
html.push('<div class="container-fluid">');
html.push('<table class="table table-bordered">');
html.push('<tr>');
html.push('<th><?php echo $this->translate("Fileset"); ?></th>');
html.push('<th><?php echo addslashes($this->translate("Fileset")); ?></th>');
html.push('<td><a href="<?php echo $this->basePath() . '/fileset/details/'; ?>' + row.filesetid + '">' + row.fileset +'</a></td>');
html.push('</tr>');
html.push('<tr>');
html.push('<th><?php echo $this->translate("Pool"); ?></th>');
html.push('<th><?php echo addslashes($this->translate("Pool")); ?></th>');
html.push('<td><a href="<?php echo $this->basePath() . '/pool/details/'; ?>' + row.poolname + '">' + row.poolname + '</a></td>');
html.push('</tr>');
html.push('<tr>');
html.push('<th><?php echo $this->translate("Scheduled"); ?></th>');
html.push('<th><?php echo addslashes($this->translate("Scheduled")); ?></th>');
html.push('<td>' + row.schedtime + '</td>');
html.push('</tr>');
html.push('<tr>');
Expand Down

0 comments on commit d29b16d

Please sign in to comment.