From 2af2711f796a2e531dc83dd239e672635a3ece4d Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 29 Aug 2006 22:45:46 +0000 Subject: [PATCH] relative+cleaned paths --- .../delete_table/delete_table.class.php | 8 +-- .../actions/edit_table/edit_table.class.php | 52 +++++++++---------- .../move_updown_table.class.php | 4 +- .../view_table_xml/view_table_xml.class.php | 4 +- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/admin/xmldb/actions/delete_table/delete_table.class.php b/admin/xmldb/actions/delete_table/delete_table.class.php index 537a3e0a61f..18a60c0b10f 100644 --- a/admin/xmldb/actions/delete_table/delete_table.class.php +++ b/admin/xmldb/actions/delete_table/delete_table.class.php @@ -63,8 +63,8 @@ class delete_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); $tableparam = required_param('table', PARAM_CLEAN); $confirmed = optional_param('confirmed', false, PARAM_BOOL); @@ -76,11 +76,11 @@ class delete_table extends XMLDBAction { $o.= '

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

' . $tableparam . '

'; $o.= ' '; $o.= '
'; $o.= '
'; - $o.= '
'; + $o.= ' '; $o.= '
'; $o.= '
'; $o.= '
'; - $o.= '
'; + $o.= ' '; $o.= '
'; $o.= '
'; diff --git a/admin/xmldb/actions/edit_table/edit_table.class.php b/admin/xmldb/actions/edit_table/edit_table.class.php index 168d8a47e9d..828b38252bd 100644 --- a/admin/xmldb/actions/edit_table/edit_table.class.php +++ b/admin/xmldb/actions/edit_table/edit_table.class.php @@ -76,8 +76,8 @@ class edit_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)) { @@ -103,7 +103,7 @@ class edit_table extends XMLDBAction { /// Add the main form $o = '
'; - $o.= ' '; + $o.= ' '; $o.= ' '; $o.= ' '; $o.= ' '; @@ -122,30 +122,30 @@ class edit_table extends XMLDBAction { $b = '

'; /// The view original XML button if ($origstructure->getTable($tableparam)) { - $b .= ' [' . $this->str['vieworiginal'] . ']'; + $b .= ' [' . $this->str['vieworiginal'] . ']'; } else { $b .= ' [' . $this->str['vieworiginal'] . ']'; } /// The view edited XML button if ($table->hasChanged()) { - $b .= ' [' . $this->str['viewedited'] . ']'; + $b .= ' [' . $this->str['viewedited'] . ']'; } else { $b .= ' [' . $this->str['viewedited'] . ']'; } /// The new field button - $b .= ' [' . $this->str['newfield'] . ']'; + $b .= ' [' . $this->str['newfield'] . ']'; /// The new key button - $b .= ' [' . $this->str['newkey'] . ']'; + $b .= ' [' . $this->str['newkey'] . ']'; /// The new index button - $b .= ' [' . $this->str['newindex'] . ']'; + $b .= ' [' . $this->str['newindex'] . ']'; /// The back to edit xml file button - $b .= ' [' . $this->str['back'] . ']'; + $b .= ' [' . $this->str['back'] . ']'; $b .= '

'; $b .= '

'; /// The view sql code button - $b .= '[' .$this->str['viewsqlcode'] . ']'; + $b .= '[' .$this->str['viewsqlcode'] . ']'; /// The view php code button - $b .= ' [' . $this->str['viewphpcode'] . ']'; + $b .= ' [' . $this->str['viewphpcode'] . ']'; $b .= '

'; $o .= $b; @@ -177,21 +177,21 @@ class edit_table extends XMLDBAction { $b = ''; /// The edit button (if the field has no uses) if (!$structure->getFieldUses($table->getName(), $field->getName())) { - $b .= '[' . $this->str['edit'] . ']'; + $b .= '[' . $this->str['edit'] . ']'; } else { $b .= '[' . $this->str['edit'] . ']'; } $b .= ''; /// The up button if ($field->getPrevious()) { - $b .= '[' . $this->str['up'] . ']'; + $b .= '[' . $this->str['up'] . ']'; } else { $b .= '[' . $this->str['up'] . ']'; } $b .= ''; /// The down button if ($field->getNext()) { - $b .= '[' . $this->str['down'] . ']'; + $b .= '[' . $this->str['down'] . ']'; } else { $b .= '[' . $this->str['down'] . ']'; } @@ -199,7 +199,7 @@ class edit_table extends XMLDBAction { /// The delete button (if we have more than one and it isn't used if (count($fields) > 1 && !$structure->getFieldUses($table->getName(), $field->getName())) { - $b .= '[' . $this->str['delete'] . ']'; + $b .= '[' . $this->str['delete'] . ']'; } else { $b .= '[' . $this->str['delete'] . ']'; } @@ -210,7 +210,7 @@ class edit_table extends XMLDBAction { /// The readable info $r = '' . $field->readableInfo() . ''; /// Print table row - $o .= '' . $field->getName() . '' . $b . $r . ''; + $o .= '' . $field->getName() . '' . $b . $r . ''; $row = ($row + 1) % 2; } $o .= ''; @@ -226,35 +226,35 @@ class edit_table extends XMLDBAction { $b = ''; /// The edit button (if the key hasn't uses) if (!$structure->getKeyUses($table->getName(), $key->getName())) { - $b .= '[' . $this->str['edit'] . ']'; + $b .= '[' . $this->str['edit'] . ']'; } else { $b .= '[' . $this->str['edit'] . ']'; } $b .= ''; /// The up button if ($key->getPrevious()) { - $b .= '[' . $this->str['up'] . ']'; + $b .= '[' . $this->str['up'] . ']'; } else { $b .= '[' . $this->str['up'] . ']'; } $b .= ''; /// The down button if ($key->getNext()) { - $b .= '[' . $this->str['down'] . ']'; + $b .= '[' . $this->str['down'] . ']'; } else { $b .= '[' . $this->str['down'] . ']'; } $b .= ''; /// The delete button (if the key hasn't uses) if (!$structure->getKeyUses($table->getName(), $key->getName())) { - $b .= '[' . $this->str['delete'] . ']'; + $b .= '[' . $this->str['delete'] . ']'; } else { $b .= '[' . $this->str['delete'] . ']'; } /// The readable info $r = '' . $key->readableInfo() . ''; /// Print table row - $o .= '' . $key->getName() . '' . $b . $r .''; + $o .= '' . $key->getName() . '' . $b . $r .''; $row = ($row + 1) % 2; } $o .= ''; @@ -269,28 +269,28 @@ class edit_table extends XMLDBAction { /// Calculate buttons $b = ''; /// The edit button - $b .= '[' . $this->str['edit'] . ']'; + $b .= '[' . $this->str['edit'] . ']'; $b .= ''; /// The up button if ($index->getPrevious()) { - $b .= '[' . $this->str['up'] . ']'; + $b .= '[' . $this->str['up'] . ']'; } else { $b .= '[' . $this->str['up'] . ']'; } $b .= ''; /// The down button if ($index->getNext()) { - $b .= '[' . $this->str['down'] . ']'; + $b .= '[' . $this->str['down'] . ']'; } else { $b .= '[' . $this->str['down'] . ']'; } $b .= ''; /// The delete button - $b .= '[' . $this->str['delete'] . ']'; + $b .= '[' . $this->str['delete'] . ']'; /// The readable info $r = '' . $index->readableInfo() . ''; /// Print table row - $o .= '' . $index->getName() . '' . $b . $r .''; + $o .= '' . $index->getName() . '' . $b . $r .''; $row = ($row + 1) % 2; } $o .= ''; diff --git a/admin/xmldb/actions/move_updown_table/move_updown_table.class.php b/admin/xmldb/actions/move_updown_table/move_updown_table.class.php index 58e2660140f..b2dd3ed891f 100644 --- a/admin/xmldb/actions/move_updown_table/move_updown_table.class.php +++ b/admin/xmldb/actions/move_updown_table/move_updown_table.class.php @@ -61,8 +61,8 @@ class move_updown_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/view_table_xml/view_table_xml.class.php b/admin/xmldb/actions/view_table_xml/view_table_xml.class.php index 2722f304c5a..d8070510cde 100644 --- a/admin/xmldb/actions/view_table_xml/view_table_xml.class.php +++ b/admin/xmldb/actions/view_table_xml/view_table_xml.class.php @@ -64,8 +64,8 @@ class view_table_xml extends XMLDBAction { $table = required_param('table', PARAM_CLEAN); $select = required_param('select', PARAM_ALPHA); //original/edited /// 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 ($select == 'original') {