Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed double attribute encoding for by-reference URLs and titles.

  • Loading branch information...
commit 19d69e9018f7c404d820044e0dd04354ce30dba9 1 parent ef6e252
@michelf authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 markdown.php
View
8 markdown.php
@@ -347,9 +347,8 @@ function stripLinkDefinitions($text) {
}
function _stripLinkDefinitions_callback($matches) {
$link_id = strtolower($matches[1]);
- $this->urls[$link_id] = $this->encodeAttribute($matches[2]);
- if (isset($matches[3]))
- $this->titles[$link_id] = $this->encodeAttribute($matches[3]);
+ $this->urls[$link_id] = $matches[2];
+ $this->titles[$link_id] =& $matches[3];
return ''; # String that will replace the block
}
@@ -828,10 +827,11 @@ function _doImages_reference_callback($matches) {
$alt_text = $this->encodeAttribute($alt_text);
if (isset($this->urls[$link_id])) {
- $url = $this->urls[$link_id];
+ $url = $this->encodeAttribute($this->urls[$link_id]);
$result = "<img src=\"$url\" alt=\"$alt_text\"";
if (isset($this->titles[$link_id])) {
$title = $this->titles[$link_id];
+ $title = $this->encodeAttribute($title);
$result .= " title=\"$title\"";
}
$result .= $this->empty_element_suffix;
Please sign in to comment.
Something went wrong with that request. Please try again.