]> git.mjollnir.org Git - moodle.git/commitdiff
Follow up for MDL-9753, accepts HTML for $text param (THEME->larrow, rarrow don't...
authornfreear <nfreear>
Tue, 22 May 2007 08:59:56 +0000 (08:59 +0000)
committernfreear <nfreear>
Tue, 22 May 2007 08:59:56 +0000 (08:59 +0000)
lib/weblib.php

index 4215cf18c70d0995e140cab04338d6e75a1cf621..cbcdbd19503eb8fa235127eecdcc20546398cfe1 100644 (file)
@@ -3110,7 +3110,7 @@ function check_theme_arrows() {
 /**
  * Return the right arrow with text ('next'), and optionally embedded in a link.
  * See function above, check_theme_arrows.
- * @param string $text Plain text label (set to blank only for breadcrumb separator cases).
+ * @param string $text HTML/plain text label (set to blank only for breadcrumb separator cases).
  * @param string $url An optional link to use in a surrounding HTML anchor.
  * @param bool $accesshide True if text should be hidden (for screen readers only).
  * @param string $addclass Additional class names for the link, or the arrow character.
@@ -3126,7 +3126,7 @@ function link_arrow_right($text, $url='', $accesshide=false, $addclass='') {
     $arrow = '<span class="'.$arrowclass.'">'.$THEME->rarrow.'</span>';
     $htmltext = '';
     if ($text) {
-        $htmltext = htmlspecialchars($text).'&nbsp;';
+        $htmltext = $text.'&nbsp;';
         if ($accesshide) {
             $htmltext = '<span class="accesshide">'.$htmltext.'</span>';
         }
@@ -3136,7 +3136,7 @@ function link_arrow_right($text, $url='', $accesshide=false, $addclass='') {
         if ($addclass) {
             $class =" class=\"$addclass\"";
         }
-        return '<a'.$class.' href="'.$url.'" title="'.htmlspecialchars($text).'">'.$htmltext.$arrow.'</a>';
+        return '<a'.$class.' href="'.$url.'" title="'.preg_replace('/<.*?>/','',$text).'">'.$htmltext.$arrow.'</a>';
     }
     return $htmltext.$arrow;
 }
@@ -3144,7 +3144,7 @@ function link_arrow_right($text, $url='', $accesshide=false, $addclass='') {
 /**
  * Return the left arrow with text ('previous'), and optionally embedded in a link.
  * See function above, check_theme_arrows.
- * @param string $text Plain text label (set to blank only for breadcrumb separator cases).
+ * @param string $text HTML/plain text label (set to blank only for breadcrumb separator cases).
  * @param string $url An optional link to use in a surrounding HTML anchor.
  * @param bool $accesshide True if text should be hidden (for screen readers only).
  * @param string $addclass Additional class names for the link, or the arrow character.
@@ -3160,7 +3160,7 @@ function link_arrow_left($text, $url='', $accesshide=false, $addclass='') {
     $arrow = '<span class="'.$arrowclass.'">'.$THEME->larrow.'</span>';
     $htmltext = '';
     if ($text) {
-        $htmltext = '&nbsp;'.htmlspecialchars($text);
+        $htmltext = '&nbsp;'.$text;
         if ($accesshide) {
             $htmltext = '<span class="accesshide">'.$htmltext.'</span>';
         }
@@ -3170,7 +3170,7 @@ function link_arrow_left($text, $url='', $accesshide=false, $addclass='') {
         if ($addclass) {
             $class =" class=\"$addclass\"";
         }
-        return '<a'.$class.' href="'.$url.'" title="'.htmlspecialchars($text).'">'.$arrow.$htmltext.'</a>';
+        return '<a'.$class.' href="'.$url.'" title="'.preg_replace('/<.*?>/','',$text).'">'.$arrow.$htmltext.'</a>';
     }
     return $arrow.$htmltext;
 }