Skip to content

Commit

Permalink
Issue mozfr#381:
Browse files Browse the repository at this point in the history
- escape html in result strings in entities view
- also fixes bad html in table generation for both string and entities searches
- whitespace changes
  • Loading branch information
pascalchevrel committed Oct 8, 2014
1 parent 9203ed2 commit ff0315c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
4 changes: 1 addition & 3 deletions app/classes/Transvision/ShowResults.php
Expand Up @@ -352,9 +352,7 @@ public static function resultsTable($search_results, $recherche, $locale1, $loca
<report a bug>
</a>
</div>
</td>
</tr>";

</td>";
} else {
$extra_column_rows = '';
}
Expand Down
15 changes: 7 additions & 8 deletions app/views/results_entities.php
@@ -1,8 +1,7 @@
<?php
namespace Transvision;


$table = "<table class='collapsable'>
$table = "<table class='collapsable'>
<tr>
<th>Entity</th>
<th>{$source_locale}</th>
Expand All @@ -21,7 +20,6 @@
}

if ($url['path'] == '3locales') {

if (isset($tmx_target2[$entity])) {
// nbsp highlight
$target_string2 = str_replace(' ', '<span class="highlight-gray"> </span>', $tmx_target2[$entity]);
Expand All @@ -34,7 +32,6 @@
} else {
$path_locale3 = VersionControl::hgPath($locale2, $check['repo'], $entity);
}

}

if (isset($tmx_target[$entity])) {
Expand All @@ -44,7 +41,10 @@
$target_string = '';
}

$source_string = $tmx_source[$entity];
// Escape strings for HTML Display
$source_string = Utils::secureText($tmx_source[$entity]);
$target_string = Utils::secureText($target_string);
$target_string2 = Utils::secureText($target_string2);

// 3locales view
if ($url['path'] == '3locales') {
Expand All @@ -61,16 +61,15 @@

$extra_column_rows = "
<td dir='{$direction3}'>
<span class='celltitle'>{$locale3}</span>
<span class='celltitle'>{$locale2}</span>
<div class='string'>{$target_string2}</div>
<div dir='ltr' class='infos'>
<a class='source_link' href='{$path_locale3}'>
<em>&lt;source&gt;</em>
</a>
{$file_bug}
</div>
</td>
</tr>";
</td>";

} else {
$extra_column_rows = '';
Expand Down

0 comments on commit ff0315c

Please sign in to comment.