From c080aa88d7c06dcf5d77eb3144223a4d010b1260 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 29 Aug 2006 20:50:44 +0000 Subject: [PATCH] relative+cleaned paths --- .../create_xml_file/create_xml_file.class.php | 4 ++-- .../delete_xml_file/delete_xml_file.class.php | 6 +++--- .../load_xml_file/load_xml_file.class.php | 4 ++-- .../actions/main_view/main_view.class.php | 18 +++++++++--------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/admin/xmldb/actions/create_xml_file/create_xml_file.class.php b/admin/xmldb/actions/create_xml_file/create_xml_file.class.php index 8ec80ffce2..6425119c30 100644 --- a/admin/xmldb/actions/create_xml_file/create_xml_file.class.php +++ b/admin/xmldb/actions/create_xml_file/create_xml_file.class.php @@ -65,8 +65,8 @@ class create_xml_file extends XMLDBAction { /// Do the job, setting result as needed /// Get the dir containing the file - $dirpath = required_param('dir', PARAM_CLEAN); - $dirpath = stripslashes_safe($dirpath); + $dirpath = required_param('dir', PARAM_PATH); + $dirpath = $CFG->dirroot . stripslashes_safe($dirpath); $file = $dirpath . '/install.xml'; /// Some variables diff --git a/admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php b/admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php index 27d42081c2..6ee54d8651 100644 --- a/admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php +++ b/admin/xmldb/actions/delete_xml_file/delete_xml_file.class.php @@ -64,7 +64,7 @@ class delete_xml_file extends XMLDBAction { /// Get the dir containing the file $dirpath = required_param('dir', PARAM_CLEAN); - $dirpath = stripslashes_safe($dirpath); + $dirpath = $CFG->dirroot . stripslashes_safe($dirpath); $confirmed = optional_param('confirmed', false, PARAM_BOOL); @@ -72,10 +72,10 @@ class delete_xml_file extends XMLDBAction { if (!$confirmed) { $o = ''; $o.= '
'; - $o.= '

' . $this->str['confirmdeletexmlfile'] . '

' . $dirpath . '

'; + $o.= '

' . $this->str['confirmdeletexmlfile'] . '

' . $dirpath . '/install.php

'; $o.= ' '; + $elementtext = '' . $elementtext . ''; } else { $elementtext = $elementtext . ''; } -- 2.39.5
'; $o.= '
'; - $o.= '
'; + $o.= ' '; $o.= '
'; $o.= '
'; $o.= '
'; diff --git a/admin/xmldb/actions/load_xml_file/load_xml_file.class.php b/admin/xmldb/actions/load_xml_file/load_xml_file.class.php index 6c782dc69f..32c35464b9 100644 --- a/admin/xmldb/actions/load_xml_file/load_xml_file.class.php +++ b/admin/xmldb/actions/load_xml_file/load_xml_file.class.php @@ -65,8 +65,8 @@ class load_xml_file extends XMLDBAction { /// Do the job, setting $result as needed /// Get the dir containing the file - $dirpath = required_param('dir', PARAM_CLEAN); - $dirpath = stripslashes_safe($dirpath); + $dirpath = required_param('dir', PARAM_PATH); + $dirpath = $CFG->dirroot . stripslashes_safe($dirpath); /// Get the correct dir if (!empty($XMLDB->dbdirs)) { diff --git a/admin/xmldb/actions/main_view/main_view.class.php b/admin/xmldb/actions/main_view/main_view.class.php index 8811ab12e8..f46381e7cc 100644 --- a/admin/xmldb/actions/main_view/main_view.class.php +++ b/admin/xmldb/actions/main_view/main_view.class.php @@ -96,7 +96,7 @@ class main_view extends XMLDBAction { foreach ($XMLDB->dbdirs as $key => $dbdir) { /// Detect if this is the lastused dir $hithis = false; - if ($key == $lastused) { + if (str_replace($CFG->dirroot, '', $key) == $lastused) { $hithis = true; } $elementtext = str_replace($CFG->dirroot . '/', '', $key); @@ -120,7 +120,7 @@ class main_view extends XMLDBAction { if ($dbdir->path_exists && !file_exists($key . '/install.xml') && is_writeable($key)) { - $b .= '[' . $this->str['create'] . ']'; + $b .= '[' . $this->str['create'] . ']'; } else { $b .= '[' . $this->str['create'] . ']'; } @@ -130,7 +130,7 @@ class main_view extends XMLDBAction { file_exists($key . '/install.xml') && is_readable($key . '/install.xml') && empty($dbdir->xml_loaded)) { - $b .= '[' . $this->str['load'] . ']'; + $b .= '[' . $this->str['load'] . ']'; } else { $b .= '[' . $this->str['load'] . ']'; } @@ -141,7 +141,7 @@ class main_view extends XMLDBAction { is_readable($key . '/install.xml') && is_readable($key) && !empty($dbdir->xml_loaded)) { - $b .= '[' . $this->str['edit'] . ']'; + $b .= '[' . $this->str['edit'] . ']'; } else { $b .= '[' . $this->str['edit'] . ']'; } @@ -153,7 +153,7 @@ class main_view extends XMLDBAction { is_writeable($key) && !empty($dbdir->xml_loaded) && !empty($dbdir->xml_changed)) { - $b .= '[' . $this->str['save'] . ']'; + $b .= '[' . $this->str['save'] . ']'; } else { $b .= '[' . $this->str['save'] . ']'; } @@ -165,7 +165,7 @@ class main_view extends XMLDBAction { is_writeable($key) && !empty($dbdir->xml_loaded) && !empty($dbdir->xml_changed)) { - $b .= '[' . $this->str['revert'] . ']'; + $b .= '[' . $this->str['revert'] . ']'; } else { $b .= '[' . $this->str['revert'] . ']'; } @@ -176,7 +176,7 @@ class main_view extends XMLDBAction { is_readable($key . '/install.xml') && !empty($dbdir->xml_loaded) && empty($dbdir->xml_changed)) { - $b .= '[' . $this->str['unload'] . ']'; + $b .= '[' . $this->str['unload'] . ']'; } else { $b .= '[' . $this->str['unload'] . ']'; } @@ -187,7 +187,7 @@ class main_view extends XMLDBAction { is_readable($key . '/install.xml') && is_writeable($key) && empty($dbdir->xml_loaded)) { - $b .= '[' . $this->str['delete'] . ']'; + $b .= '[' . $this->str['delete'] . ']'; } else { $b .= '[' . $this->str['delete'] . ']'; } @@ -196,7 +196,7 @@ class main_view extends XMLDBAction { if ($dbdir->path_exists && file_exists($key . '/install.xml') && is_readable($key . '/install.xml')) { - $elementtext = '' . $elementtext . '