Fixed improper Markdown escaping for some tooltips

This commit is contained in:
Frederic Guillot
2016-04-29 18:43:57 -04:00
parent a34f83fb30
commit 9fa8f63d25
11 changed files with 30 additions and 9 deletions

View File

@@ -38,6 +38,18 @@ class TextHelper extends Base
return $parser->text($text);
}
/**
* Escape Markdown text that need to be stored in HTML attribute
*
* @access public
* @param string $text
* @return mixed
*/
public function markdownAttribute($text)
{
return htmlentities($this->markdown($text), ENT_QUOTES, 'UTF-8');
}
/**
* Format a file size
*

View File

@@ -31,7 +31,7 @@
<?= $this->url->link($this->text->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?>
<?php if (! empty($project['description'])): ?>
<span class="tooltip" title='<?= $this->text->e($this->text->markdown($project['description'])) ?>'>
<span class="tooltip" title="<?= $this->text->markdownAttribute($project['description']) ?>">
<i class="fa fa-info-circle"></i>
</span>
<?php endif ?>

View File

@@ -47,7 +47,7 @@
</span>
<?php if (! $not_editable && ! empty($column['description'])): ?>
<span class="tooltip pull-right" title='<?= $this->text->e($this->text->markdown($column['description'])) ?>'>
<span class="tooltip pull-right" title="<?= $this->text->markdownAttribute($column['description']) ?>">
&nbsp;<i class="fa fa-info-circle"></i>
</span>
<?php endif ?>

View File

@@ -11,7 +11,7 @@
array('task_id' => $task['id'], 'project_id' => $task['project_id']),
false,
'popover' . (! empty($task['category_description']) ? ' tooltip' : ''),
! empty($task['category_description']) ? $this->text->markdown($task['category_description']) : t('Change category')
! empty($task['category_description']) ? $this->text->markdownAttribute($task['category_description']) : t('Change category')
) ?>
<?php endif ?>
</span>
@@ -76,7 +76,7 @@
<i class="fa fa-flag flag-milestone"></i>
</span>
<?php endif ?>
<?= $this->hook->render('template:board:task:icons', array('task' => $task)) ?>
<?= $this->task->formatPriority($project, $task) ?>

View File

@@ -28,7 +28,7 @@
<i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>"></i>
<?= $this->text->e($column['title']) ?>
<?php if (! empty($column['description'])): ?>
<span class="tooltip" title='<?= $this->text->e($this->text->markdown($column['description'])) ?>'>
<span class="tooltip" title="<?= $this->text->markdownAttribute($column['description']) ?>">
<i class="fa fa-info-circle"></i>
</span>
<?php endif ?>

View File

@@ -8,7 +8,7 @@
<?= $this->text->e($title) ?>
</span>
<?php if (! empty($description)): ?>
<span class="tooltip" title='<?= $this->text->e($this->text->markdown($description)) ?>'>
<span class="tooltip" title="<?= $this->text->markdownAttribute($description) ?>">
<i class="fa fa-info-circle"></i>
</span>
<?php endif ?>

View File

@@ -49,7 +49,7 @@
<?php endif ?>
<?php if (! empty($project['description'])): ?>
<span class="tooltip" title='<?= $this->text->e($this->text->markdown($project['description'])) ?>'>
<span class="tooltip" title="<?= $this->text->markdownAttribute($project['description']) ?>">
<i class="fa fa-info-circle"></i>
</span>
<?php endif ?>

View File

@@ -63,7 +63,7 @@
<td>
<?= $this->text->e($column['title']) ?>
<?php if (! empty($column['description'])): ?>
<span class="tooltip" title='<?= $this->text->e($this->text->markdown($column['description'])) ?>'>
<span class="tooltip" title="<?= $this->text->markdownAttribute($column['description']) ?>">
<i class="fa fa-info-circle"></i>
</span>
<?php endif ?>

View File

@@ -45,7 +45,7 @@
<?= $this->text->e($swimlane['name']) ?>
<?php if (! empty($swimlane['description'])): ?>
<span class="tooltip" title='<?= $this->text->e($this->text->markdown($swimlane['description'])) ?>'>
<span class="tooltip" title="<?= $this->text->markdownAttribute($swimlane['description']) ?>">
<i class="fa fa-info-circle"></i>
</span>
<?php endif ?>