Duplicate slashes in filenames have been removed.

skala
Ivan Tcholakov 15 years ago
parent e60b9b6a31
commit 7e40ec0aac
  1. 2
      main/admin/session_export.php
  2. 2
      main/dropbox/dropbox_download.php
  3. 2
      main/dropbox/dropbox_functions.inc.php
  4. 48
      main/forum/index.php
  5. 18
      main/inc/lib/fckeditor/repository.php
  6. 2
      main/inc/lib/search/get_terms.php
  7. 4
      main/inc/lib/search/search_widget.php
  8. 2
      main/inc/lib/search/xapian/XapianQuery.php
  9. 24
      main/social/group_add.php
  10. 4
      tests/main/inc/lib/fileUpload.lib.test.php
  11. 2
      tests/main/newscorm/scorm.lib.test.php
  12. 2
      tests/main/scorm/scorm.lib.test.php

@ -37,7 +37,7 @@ include '../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(true);
include api_get_path(LIBRARY_PATH).'/fileManage.lib.php';
include api_get_path(LIBRARY_PATH).'fileManage.lib.php';
$session_id = intval($_GET['session_id']);
$formSent = 0;

@ -99,7 +99,7 @@ else {
$work = new Dropbox_work($_GET['id']);
$path = dropbox_cnf('sysPath') . '/' . $work -> filename; //path to file as stored on server
$file = $work->title;
require_once api_get_path(LIBRARY_PATH) . '/document.lib.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
$mimetype = DocumentManager::file_get_mime_type(true);
$fileparts = explode('.', $file);
$filepartscount = count($fileparts);

@ -1037,7 +1037,7 @@ function zip_download($array) {
$sys_course_path = api_get_path(SYS_COURSE_PATH);
// zip library for creation of the zipfile
require api_get_path(LIBRARY_PATH).'/pclzip/pclzip.lib.php';
require api_get_path(LIBRARY_PATH).'pclzip/pclzip.lib.php';
// place to temporarily stash the zipfiles
$temp_zip_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/temp/';

@ -51,7 +51,7 @@ $this_section=SECTION_COURSES;
api_protect_course_script(true);
// including additional library scripts
require_once api_get_path(LIBRARY_PATH).'/text.lib.php';
require_once api_get_path(LIBRARY_PATH).'text.lib.php';
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
$nameTools=get_lang('Forums');
@ -117,7 +117,7 @@ if (api_is_allowed_to_edit(false,true)) {
// notification
if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['content']) AND isset($_GET['id'])) {
if (api_get_session_id()!=0 && api_is_allowed_to_session_edit(false,true)==false) {
if (api_get_session_id()!=0 && api_is_allowed_to_session_edit(false,true)==false) {
api_not_allowed();
}
$return_message = set_notification($_GET['content'],$_GET['id']);
@ -128,7 +128,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
$whatsnew_post_info = array();
$whatsnew_post_info = $_SESSION['whatsnew_post_info'];
/*
/*
TRACKING
*/
event_access_tool(TOOL_FORUM);
@ -145,7 +145,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
// step 2: we find all the forums (only the visible ones if it is a student)
$forum_list = array();
$forum_list = get_forums();
/*
RETRIEVING ALL GROUPS AND THOSE OF THE USER
@ -164,15 +164,15 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
}
}
/*
CLEAN GROUP ID FOR AJAXFILEMANAGER
/*
CLEAN GROUP ID FOR AJAXFILEMANAGER
*/
if(isset($_SESSION['_gid'])) {
unset($_SESSION['_gid']);
}
/*
ACTION LINKS
/*
ACTION LINKS
*/
$session_id=isset($_SESSION['id_session']) ? $_SESSION['id_session'] : false;
//if (api_is_allowed_to_edit() and !$_GET['action'])
@ -187,27 +187,27 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
}
echo '</div>';
/*
Display Forum Categories and the Forums in it
*/
/*
Display Forum Categories and the Forums in it
*/
echo '<table class="data_table">';
// Step 3: we display the forum_categories first
if(is_array($forum_categories_list)) {
foreach ($forum_categories_list as $forum_category_key => $forum_category) {
//validacion when belongs to a session
$session_img = api_get_session_image($forum_category['session_id'], $_user['status']);
if((!isset($_SESSION['id_session']) || $_SESSION['id_session']==0) && !empty($forum_category['session_name'])) {
$session_displayed = ' ('.Security::remove_XSS($forum_category['session_name']).')';
} else {
$session_displayed = '';
}
echo "<tr><th style=\"padding-left:5px;\" align=\"left\" colspan=\"5\">";
echo "<tr><th style=\"padding-left:5px;\" align=\"left\" colspan=\"5\">";
echo '<a href="viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.prepare4display($forum_category['cat_id']).'" '.class_visible_invisible(prepare4display($forum_category['visibility'])).'>'.prepare4display($forum_category['cat_title']).$session_displayed.'</a>'. $session_img .'<br />';
if ($forum_category['cat_comment']<>'' AND trim($forum_category['cat_comment'])<>'&nbsp;') {
if ($forum_category['cat_comment']<>'' AND trim($forum_category['cat_comment'])<>'&nbsp;') {
echo '<span class="forum_description">'.prepare4display($forum_category['cat_comment']).'</span>';
}
echo '</th>';
@ -338,10 +338,10 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
}
}
echo "</td>";
//validacion when belongs to a session
$session_img = api_get_session_image($forum['session_id'], $_user['status']);
if ($forum['forum_of_group'] <> '0') {
$my_all_groups_forum_name = isset($all_groups[$forum['forum_of_group']]['name']) ? $all_groups[$forum['forum_of_group']]['name'] : null;
$my_all_groups_forum_id = isset($all_groups[$forum['forum_of_group']]['id']) ? $all_groups[$forum['forum_of_group']]['id'] : null;
@ -357,11 +357,11 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
$session_displayed = '';
}
$forum['forum_of_group']==0?$groupid='':$groupid=$forum['forum_of_group'];
echo "<td><a href=\"viewforum.php?".api_get_cidreq()."&gidReq=".intval($groupid)."&forum=".intval($forum['forum_id'])."\" ".class_visible_invisible(prepare4display($forum['visibility'])).">";
//Forum title
echo prepare4display($forum['forum_title']).$session_displayed.'</a>'.$forum_title_group_addition.'<br />'.prepare4display($forum['forum_comment']);
echo '</td>';
//$number_forum_topics_and_posts=get_post_topics_of_forum($forum['forum_id']); // deprecated
@ -400,12 +400,12 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
}
}
if (!api_is_anonymous() && api_is_allowed_to_session_edit(false,true) ) {
if (!api_is_anonymous() && api_is_allowed_to_session_edit(false,true) ) {
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&gradebook=$gradebook&action=notify&amp;content=forum&amp;id=".$forum['forum_id']."\">".icon('../img/'.$iconnotify,get_lang('NotifyMe'))."</a>";
}
echo "</td>";
echo "</tr>";
}
}
}
}
@ -413,7 +413,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
echo "<tr><td>".get_lang('NoForumInThisCategory')."</td>".(api_is_allowed_to_edit(false,true)?'<td colspan="6"></td>':'<td colspan="6"></td>')."</tr>";
}
}
}
}
echo "</table>";
/*

@ -19,14 +19,14 @@
* @since 31/December/2008
*/
require_once api_get_path(LIBRARY_PATH).'/fileUpload.lib.php';
require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
$permissions_for_new_directories = api_get_permissions_for_new_directories();
$permissions_for_new_files = api_get_permissions_for_new_files();
if (!empty($_course['path'])) {
require_once api_get_path(LIBRARY_PATH).'/document.lib.php';
require_once api_get_path(LIBRARY_PATH).'/groupmanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
// Get the Chamilo session properties. Before ajaximagemanager!!!
$to_group_id = !empty($_SESSION['_gid']) ? $_SESSION['_gid'] : 0 ;
@ -54,12 +54,12 @@ if (api_is_platform_admin()) {
// Create course shared folders
if (api_is_in_course()) {
if (api_is_in_course()) {
$course_dir = $_course['path'].'/document';
$sys_course_path = api_get_path(SYS_COURSE_PATH);
$base_work_dir = $sys_course_path.$course_dir;
$current_session_id = api_get_session_id();
if($current_session_id==0){
//Create shared folder. Necessary for courses recycled. Allways session_id should be zero. Allway should be created from a base course, never from a session.
if (!file_exists($base_work_dir.'/shared_folder')) {
@ -67,7 +67,7 @@ if (api_is_in_course()) {
$usf_dir_name = '/shared_folder';
$to_group_id = 0;
$visibility = 0;
create_unexisting_directory($_course, $_user['user_id'], $to_group_id, $to_user_id, $base_work_dir, $usf_dir_name, $usf_dir_title, $visibility);
create_unexisting_directory($_course, $_user['user_id'], $to_group_id, $to_user_id, $base_work_dir, $usf_dir_name, $usf_dir_title, $visibility);
}
// Create dynamic user shared folder
if (!file_exists($base_work_dir.'/shared_folder/sf_user_'.api_get_user_id())) {
@ -78,11 +78,11 @@ if (api_is_in_course()) {
create_unexisting_directory($_course, $_user['user_id'], $to_group_id, $to_user_id, $base_work_dir, $usf_dir_name, $usf_dir_title, $visibility);
}
}
else{
else{
//Create shared folder session
if (!file_exists($base_work_dir.'/shared_folder_session_'.$current_session_id)) {
$usf_dir_title = get_lang('SharedFolder').' ('.api_get_session_name($current_session_id).')';
$usf_dir_name = '/shared_folder_session_'.$current_session_id;
$usf_dir_name = '/shared_folder_session_'.$current_session_id;
$to_group_id = 0;
$visibility = 0;
create_unexisting_directory($_course, $_user['user_id'], $to_group_id, $to_user_id, $base_work_dir, $usf_dir_name, $usf_dir_title, $visibility);
@ -90,7 +90,7 @@ if (api_is_in_course()) {
//Create dynamic user shared folder into a shared folder session
if (!file_exists($base_work_dir.'/shared_folder_session_'.$current_session_id.'/sf_user_'.api_get_user_id())) {
$usf_dir_title = api_get_person_name($_user['firstName'], $_user['lastName']).' ('.api_get_session_name($current_session_id).')';
$usf_dir_name = '/shared_folder_session_'.$current_session_id.'/sf_user_'.api_get_user_id();
$usf_dir_name = '/shared_folder_session_'.$current_session_id.'/sf_user_'.api_get_user_id();
$to_group_id = 0;
$visibility = 1;
create_unexisting_directory($_course, $_user['user_id'], $to_group_id, $to_user_id, $base_work_dir, $usf_dir_name, $usf_dir_title, $visibility);

@ -14,7 +14,7 @@ if (empty($_GET['term']) || empty($_GET['prefix']) || !in_array($_GET['operator'
}
require_once dirname(__FILE__) . '../../../global.inc.php';
require_once api_get_path(LIBRARY_PATH).'/search/DokeosQuery.php';
require_once api_get_path(LIBRARY_PATH).'search/DokeosQuery.php';
/**
* search with filter and build base array avoding repeated terms

@ -5,7 +5,7 @@
* @package dokeos.search
*/
require_once dirname(__FILE__) . '/IndexableChunk.class.php';
require_once api_get_path(LIBRARY_PATH).'/specific_fields_manager.lib.php';
require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
//require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
/**
@ -293,7 +293,7 @@ function display_search_form($action, $show_thesaurus, $sf_terms, $op) {
*/
function search_widget_show($action='index.php') {
global $charset;
require_once api_get_path(LIBRARY_PATH).'/search/DokeosQuery.php';
require_once api_get_path(LIBRARY_PATH).'search/DokeosQuery.php';
// TODO: load images dinamically when they're avalaible from specific field ui to add
$icons_for_search_terms = array();

@ -3,7 +3,7 @@
require_once 'xapian.php';
require_once dirname(__FILE__) . '/../IndexableChunk.class.php';
//TODO: think another way without including specific fields here
require_once api_get_path(LIBRARY_PATH).'/specific_fields_manager.lib.php';
require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
define('XAPIAN_DB', api_get_path(SYS_PATH).'searchdb/');

@ -4,11 +4,11 @@
* @package dokeos.social
* @author Julio Montoya <gugli100@gmail.com>
*/
$language_file= 'userInfo';
$cidReset=true;
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'/formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php';
@ -30,19 +30,19 @@ function text_longitud(){
document.forms[0].description.value = textarea;
}else{
textarea = document.forms[0].description.value;
}
}
}
function show_icon_edit(element_html) {
function show_icon_edit(element_html) {
ident="#edit_image";
$(ident).show();
}
}
function hide_icon_edit(element_html) {
ident="#edit_image";
$(ident).hide();
}
}
</script>';
$table_message = Database::get_main_table(TABLE_MESSAGE);
$form = new FormValidator('add_group');
@ -86,19 +86,19 @@ if ($form->validate()) {
$picture_uri = '';
$name = $values['name'];
$description = $values['description'];
$url = $values['url'];
$url = $values['url'];
$status = intval($values['visibility']);
$picture = $_FILES['picture'];
$group_id = GroupPortalManager::add($name, $description, $url, $status);
GroupPortalManager::add_user_to_group(api_get_user_id(), $group_id,GROUP_USER_PERMISSION_ADMIN);
if (!empty($picture['name'])) {
$picture_uri = GroupPortalManager::update_group_picture($group_id, $_FILES['picture']['name'], $_FILES['picture']['tmp_name']);
GroupPortalManager::update($group_id, $name, $description, $url,$status, $picture_uri);
}
header('Location: groups.php?id='.$group_id.'&action=show_message&message='.urlencode(get_lang('GroupAdded')));
exit();
exit();
}
$nameTools = get_lang('AddGroup');
@ -111,11 +111,11 @@ Display :: display_header($tool_name, 'Groups');
echo '<div id="social-content">';
echo '<div id="social-content-left">';
//show the action menu
//show the action menu
SocialManager::show_social_menu('group_add');
echo '</div>';
echo '<div id="social-content-right">';
$form->display();
$form->display();
echo '</div>';
echo '</div>';

@ -1,7 +1,7 @@
<?php
require_once(api_get_path(LIBRARY_PATH).'fileUpload.lib.php');
require_once(api_get_path(LIBRARY_PATH).'document.lib.php');
require_once(api_get_path(LIBRARY_PATH).'/pclzip/pclzip.lib.php');
require_once(api_get_path(LIBRARY_PATH).'pclzip/pclzip.lib.php');
class TestFileUpload extends UnitTestCase {
@ -302,7 +302,7 @@ class TestFileUpload extends UnitTestCase {
//unzipping
function testunzip_uploaded_document() {
//require_once(api_get_path(LIBRARY_PATH).'/pclzip/pclzip.lib.php');
//require_once(api_get_path(LIBRARY_PATH).'pclzip/pclzip.lib.php');
global $_course;
global $_user;
global $to_user_id;

@ -65,7 +65,7 @@ class TestScormLib extends UnitTestCase {
* @uses removescormDir() to actually remove the directory
*/
public function testscorm_delete() {
require_once(api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
require_once(api_get_path(LIBRARY_PATH).'fileManage.lib.php');
$path_name = api_get_path(SYS_COURSE_PATH);
$file=$path_name.'scorm/';
$res=scorm_delete($file);

@ -60,7 +60,7 @@ class TestScorm extends UnitTestCase {
* @uses removescormDir() to actually remove the directory
*/
function testscorm_delete() {
require_once(api_get_path(LIBRARY_PATH).'/fileManage.lib.php');
require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
$file='/tmp/';
$res=scorm_delete($file);
$this->assertTrue(is_bool($res));

Loading…
Cancel
Save