]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8904 please no extract()s, fixed double string filtering; merged from MOODLE_18_S...
authorskodak <skodak>
Mon, 19 Mar 2007 10:37:44 +0000 (10:37 +0000)
committerskodak <skodak>
Mon, 19 Mar 2007 10:37:44 +0000 (10:37 +0000)
lib/weblib.php

index cd800d3bc9374693026f11db42bd1dacd4d0ed29..e59f3347b9d3208883dbbb53167e11ed8fae33d8 100644 (file)
@@ -2834,7 +2834,7 @@ function check_theme_arrows() {
  * Prints breadcrumb trail of links, called in theme/-/header.html
  *
  * @uses $CFG
- * @param string $navigation The breadcrumb navigation string to be printed
+ * @param mixed $navigation The breadcrumb navigation string to be printed
  * @param string $separator The breadcrumb trail separator. The default 0 leads to the use
  *  of $THEME->rarrow, themes could use '&rarr;', '/', or '' for a style-sheet solution.
  * @param boolean $return False to echo the breadcrumb string (default), true to return it.
@@ -2859,10 +2859,10 @@ function print_navigation ($navigation, $separator=0, $return=false) {
             
             foreach ($ar as $a) {
                 if (strpos($a, '</a>') === false) {
-                    $navigation[] = array('title' => trim(format_string($a)), 'url' => '');
+                    $navigation[] = array('title' => $a, 'url' => '');
                 } else {
                     if (preg_match('/<a.*href="([^"]*)">(.*)<\/a>/', $a, $matches)) {                  
-                        $navigation[] = array('title' => trim(format_string($matches[2])), 'url' => $matches[1]);
+                        $navigation[] = array('title' => $matches[2], 'url' => $matches[1]);
                     }
                 }
             }
@@ -2878,18 +2878,19 @@ function print_navigation ($navigation, $separator=0, $return=false) {
         $output .= '<h2 class="accesshide">'.$nav_text."</h2><ul>\n";
         
         $output .= '<li class="first"><a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
-               .$CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID))
+               .$CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))
                                  && !empty($USER->id) && !empty($CFG->mymoodleredirect) && !isguest())
                                  ? '/my' : '') .'/">'. format_string($site->shortname) ."</a></li>\n";
         
         
         foreach ($navigation as $navitem) {
-            extract($navitem);
-            $title = strip_tags(format_string($title));
+            $title = trim(strip_tags(format_string($navitem['title'], false)));
+            $url   = $navitem['url'];
+
             if (empty($url)) {
                 $output .= '<li class="first">'."$separator $title</li>\n";
             } else {
-                $output .= '<li class="first">' . $separator  . ' <a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
+                $output .= '<li class="first">'.$separator.' <a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
                            .$url.'">'."$title</a></li>\n";
             }
         }