Every item of the breadcrumb is check with the security::remove_XSS and cut depending of the MAX_LENGTH_BREADCRUMB constant located in the display class? This fix many bugs when using loooong document/lp titles.

skala
Julio Montoya 14 years ago
parent f5b7ba38f4
commit 43aab9b126
  1. 3
      main/inc/header.inc.php
  2. 5
      main/inc/lib/banner.lib.php
  3. 2
      main/inc/lib/display.lib.php
  4. 2
      main/newscorm/lp_build.php

@ -119,12 +119,9 @@ if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=
<script src="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/thickbox.js" type="text/javascript" ></script> <script src="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/thickbox.js" type="text/javascript" ></script>
<link rel="stylesheet" href="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/thickbox.css" type="text/css" media="projection, screen" /> <link rel="stylesheet" href="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/thickbox.css" type="text/css" media="projection, screen" />
<link rel="stylesheet" href="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/chosen/chosen.css" type="text/css" media="projection, screen" /> <link rel="stylesheet" href="<?php echo api_get_path(WEB_LIBRARY_PATH);?>javascript/chosen/chosen.css" type="text/css" media="projection, screen" />
<link rel="top" href="<?php echo api_get_path(WEB_PATH); ?>index.php" title="" /> <link rel="top" href="<?php echo api_get_path(WEB_PATH); ?>index.php" title="" />
<link rel="courses" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/courses.php" title="<?php echo api_htmlentities(get_lang('OtherCourses'), ENT_QUOTES); ?>" /> <link rel="courses" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/courses.php" title="<?php echo api_htmlentities(get_lang('OtherCourses'), ENT_QUOTES); ?>" />
<link rel="profil" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/profile.php" title="<?php echo api_htmlentities(get_lang('ModifyProfile'), ENT_QUOTES); ?>" /> <link rel="profil" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/profile.php" title="<?php echo api_htmlentities(get_lang('ModifyProfile'), ENT_QUOTES); ?>" />

@ -530,6 +530,11 @@ function show_header_4($interbreadcrumb, $language_file, $nameTools) {
} elseif($breadcrumb_step['name'] == 'gallery') { } elseif($breadcrumb_step['name'] == 'gallery') {
$navigation_item['title'] = get_lang('Gallery'); $navigation_item['title'] = get_lang('Gallery');
} }
//Fixes breadcrumb title now we applied the Security::remove_XSS and we cut the string depending of the MAX_LENGTH_BREADCRUMB value
if (api_strlen($navigation_item['title']) > MAX_LENGTH_BREADCRUMB) {
$navigation_item['title'] = api_substr($navigation_item['title'], 0, MAX_LENGTH_BREADCRUMB).' ...';
}
$navigation_item['title'] = Security::remove_XSS($navigation_item['title']);
$navigation[] = $navigation_item; $navigation[] = $navigation_item;
} }
} }

@ -22,6 +22,8 @@
* @package chamilo.library * @package chamilo.library
*/ */
define('MAX_LENGTH_BREADCRUMB', 100);
class Display { class Display {
private function __construct() { private function __construct() {

@ -108,7 +108,7 @@ if (!empty($gradebook) && $gradebook == 'view') {
); );
} }
$interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths')); $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths'));
$interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=$learnpath_id", "name" => stripslashes("{$therow['name']}")); $interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=$learnpath_id", "name" => $therow['name']);
// Theme calls. // Theme calls.
$lp_theme_css=$_SESSION['oLP']->get_theme(); $lp_theme_css=$_SESSION['oLP']->get_theme();

Loading…
Cancel
Save