Fixed improper Markdown escaping for some tooltips
This commit is contained in:
@@ -22,6 +22,7 @@ Improvements:
|
|||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|
||||||
|
* Fixed improper Markdown escaping for some tooltips
|
||||||
* Closing all tasks by column, also update closed tasks
|
* Closing all tasks by column, also update closed tasks
|
||||||
* Fixed wrong task link generation within Markdown text
|
* Fixed wrong task link generation within Markdown text
|
||||||
* Fixed wrong URL on comment toggle link for sorting
|
* Fixed wrong URL on comment toggle link for sorting
|
||||||
|
|||||||
@@ -38,6 +38,18 @@ class TextHelper extends Base
|
|||||||
return $parser->text($text);
|
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
|
* Format a file size
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<?= $this->url->link($this->text->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?>
|
<?= $this->url->link($this->text->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?>
|
||||||
<?php if (! empty($project['description'])): ?>
|
<?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>
|
<i class="fa fa-info-circle"></i>
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<?php if (! $not_editable && ! empty($column['description'])): ?>
|
<?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']) ?>">
|
||||||
<i class="fa fa-info-circle"></i>
|
<i class="fa fa-info-circle"></i>
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
array('task_id' => $task['id'], 'project_id' => $task['project_id']),
|
array('task_id' => $task['id'], 'project_id' => $task['project_id']),
|
||||||
false,
|
false,
|
||||||
'popover' . (! empty($task['category_description']) ? ' tooltip' : ''),
|
'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 ?>
|
<?php endif ?>
|
||||||
</span>
|
</span>
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
<i class="fa fa-flag flag-milestone"></i>
|
<i class="fa fa-flag flag-milestone"></i>
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?= $this->hook->render('template:board:task:icons', array('task' => $task)) ?>
|
<?= $this->hook->render('template:board:task:icons', array('task' => $task)) ?>
|
||||||
|
|
||||||
<?= $this->task->formatPriority($project, $task) ?>
|
<?= $this->task->formatPriority($project, $task) ?>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>"></i>
|
<i class="fa fa-arrows-alt draggable-row-handle" title="<?= t('Change column position') ?>"></i>
|
||||||
<?= $this->text->e($column['title']) ?>
|
<?= $this->text->e($column['title']) ?>
|
||||||
<?php if (! empty($column['description'])): ?>
|
<?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>
|
<i class="fa fa-info-circle"></i>
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<?= $this->text->e($title) ?>
|
<?= $this->text->e($title) ?>
|
||||||
</span>
|
</span>
|
||||||
<?php if (! empty($description)): ?>
|
<?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>
|
<i class="fa fa-info-circle"></i>
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (! empty($project['description'])): ?>
|
<?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>
|
<i class="fa fa-info-circle"></i>
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<?= $this->text->e($column['title']) ?>
|
<?= $this->text->e($column['title']) ?>
|
||||||
<?php if (! empty($column['description'])): ?>
|
<?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>
|
<i class="fa fa-info-circle"></i>
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
<?= $this->text->e($swimlane['name']) ?>
|
<?= $this->text->e($swimlane['name']) ?>
|
||||||
|
|
||||||
<?php if (! empty($swimlane['description'])): ?>
|
<?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>
|
<i class="fa fa-info-circle"></i>
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -51,6 +51,14 @@ class TextHelperTest extends Base
|
|||||||
$this->assertEquals('<p>Text @admin @notfound</p>', $h->markdown('Text @admin @notfound', true));
|
$this->assertEquals('<p>Text @admin @notfound</p>', $h->markdown('Text @admin @notfound', true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testMarkdownAttribute()
|
||||||
|
{
|
||||||
|
$helper = new TextHelper($this->container);
|
||||||
|
$this->assertEquals('<p>Ça marche</p>', $helper->markdownAttribute('Ça marche'));
|
||||||
|
$this->assertEquals('<p>Test with &quot;double quotes&quot;</p>', $helper->markdownAttribute('Test with "double quotes"'));
|
||||||
|
$this->assertEquals('<p>Test with 'single quotes'</p>', $helper->markdownAttribute("Test with 'single quotes'"));
|
||||||
|
}
|
||||||
|
|
||||||
public function testFormatBytes()
|
public function testFormatBytes()
|
||||||
{
|
{
|
||||||
$h = new TextHelper($this->container);
|
$h = new TextHelper($this->container);
|
||||||
|
|||||||
Reference in New Issue
Block a user