Skip to content

Commit

Permalink
MDL-21362 fixed incorrect url constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jan 17, 2010
1 parent 2593c1c commit 5e991e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions files/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
/// process actions
if ($file_info and $file_info->is_directory() and $file_info->is_writable() and $newdirname !== '' and data_submitted() and confirm_sesskey()) {
if ($newdir_info = $file_info->create_directory($newdirname, $USER->id)) {
$params = $newdir_info->get_params_rawencoded();
$params = $newdir_info->get_params();
redirect(new moodle_url('index.php', $params));
} else {
$error = "Could not create new dir"; // TODO: localise
Expand All @@ -94,7 +94,7 @@
if (is_uploaded_file($_FILES['newfile']['tmp_name'])) {
try {
if ($newfile = $file_info->create_file_from_pathname($newfilename, $_FILES['newfile']['tmp_name'], $USER->id)) {
$params = $file_info->get_params_rawencoded();
$params = $file_info->get_params();
redirect(new moodle_url('index.php', $params));

} else {
Expand Down Expand Up @@ -126,7 +126,7 @@
if (!$file_info->delete()) {
$error = "Could not delete file!"; // TODO: localise
}
$params = $parent_info->get_params_rawencoded();
$params = $parent_info->get_params();
redirect(new moodle_url('index.php', $params));
}
}
Expand Down Expand Up @@ -184,7 +184,7 @@ function html_header($context, $file_info){

$strfiles = get_string("files");
build_navbar_for_file($PAGE, $file_info);
$PAGE->set_url("/files/index.php", $file_info->get_params_rawencoded());
$PAGE->set_url("/files/index.php", $file_info->get_params());
$PAGE->set_title("$SITE->shortname: $strfiles");
echo $OUTPUT->header();

Expand Down
2 changes: 1 addition & 1 deletion lib/file/file_browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class file_browser {
* @param int $itemid
* @param string $filepath
* @param string $filename
* @return object file_info object or null if not found or access not allowed
* @return file_info instance or null if not found or access not allowed
*/
public function get_file_info($context, $filearea=null, $itemid=null, $filepath=null, $filename=null) {
switch ($context->contextlevel) {
Expand Down

0 comments on commit 5e991e3

Please sign in to comment.