From: stronk7 Date: Tue, 29 Aug 2006 22:17:25 +0000 (+0000) Subject: relative+cleaned paths X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=115a73653a60cdd21ff64e00bf05b5002805c21b;p=moodle.git relative+cleaned paths --- diff --git a/admin/xmldb/actions/new_statement/new_statement.class.php b/admin/xmldb/actions/new_statement/new_statement.class.php index 8dfc3137db..526d58d0ef 100644 --- a/admin/xmldb/actions/new_statement/new_statement.class.php +++ b/admin/xmldb/actions/new_statement/new_statement.class.php @@ -64,8 +64,8 @@ class new_statement 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 dirs if (!empty($XMLDB->dbdirs)) { @@ -103,13 +103,13 @@ class new_statement extends XMLDBAction { } /// Now build the form $o = '
'; - $o.= ' '; + $o.= ' '; $o.= ' '; $o.= ' '; $o.= ' '; $o.= ' '; $o.= ' '; - $o.= ' '; + $o.= ' '; $o.= '
' . choose_from_menu($typeoptions, 'type', '', 'choose', '', 0, true) . '' .choose_from_menu($selecttables, 'table', '', 'choose', '', 0, true) . '
[' . $this->str['back'] . ']
[' . $this->str['back'] . ']
'; $o.= '
'; diff --git a/admin/xmldb/actions/new_table/new_table.class.php b/admin/xmldb/actions/new_table/new_table.class.php index 98cabf8708..da7b342287 100644 --- a/admin/xmldb/actions/new_table/new_table.class.php +++ b/admin/xmldb/actions/new_table/new_table.class.php @@ -61,8 +61,8 @@ class new_table 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 dirs if (!empty($XMLDB->dbdirs)) { diff --git a/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php b/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php index 549a920c6e..162cb70f1f 100644 --- a/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php +++ b/admin/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php @@ -64,8 +64,8 @@ class new_table_from_mysql 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 dirs if (!empty($XMLDB->dbdirs)) { @@ -107,13 +107,13 @@ class new_table_from_mysql extends XMLDBAction { } /// Now build the form $o = '
'; - $o.= ' '; + $o.= ' '; $o.= ' '; $o.= ' '; $o.= ' '; $o.= ' '; $o.= ' '; - $o.= ' '; + $o.= ' '; $o.= '
' . choose_from_menu($selecttables, 'table', '', 'choose', '', 0, true) . '' .choose_from_menu($aftertables, 'after', '', 'choose', '', 0, true) . '
[' . $this->str['back'] . ']
[' . $this->str['back'] . ']
'; $o.= '
'; diff --git a/admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php b/admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php index 81ad972b1c..36fbb8e753 100644 --- a/admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php +++ b/admin/xmldb/actions/view_structure_sql/view_structure_sql.class.php @@ -62,8 +62,8 @@ class view_structure_sql 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 dirs if (!empty($XMLDB->dbdirs)) { @@ -78,7 +78,7 @@ class view_structure_sql extends XMLDBAction { /// ADD YOUR CODE HERE /// Get parameters - $generatorparam = optional_param('generator', null, PARAM_CLEAN); + $generatorparam = optional_param('generator', null, PARAM_ALPHANUM); if (empty($generatorparam)) { $generatorparam = $CFG->dbtype; } @@ -96,7 +96,7 @@ class view_structure_sql extends XMLDBAction { /// The back to edit table button $b = '

'; - $b .= '[' . $this->str['back'] . ']'; + $b .= '[' . $this->str['back'] . ']'; $b .= '

'; $o = $b; @@ -104,7 +104,7 @@ class view_structure_sql extends XMLDBAction { $o.= ' ' . $this->str['selectdb']; /// Show the popup of generators - $url = 'index.php?action=view_structure_sql&dir=' . urlencode($dirpath) . '&generator='; + $url = 'index.php?action=view_structure_sql&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '&generator='; $o.= popup_form($url, $generators, 'selectgenerator', $generatorparam, '', '', '' , true); $o.= ' '; $o.= '