/// Do the job, setting result as needed
+ if (!data_submitted('nomatch')) { ///Basic prevention
+ error('Wrong action call');
+ }
+
/// Get parameters
- $dirpath = required_param('dir', PARAM_CLEAN);
- $dirpath = stripslashes_safe($dirpath);
+ $dirpath = required_param('dir', PARAM_PATH);
+ $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
- $tableparam = strtolower(required_param('table', PARAM_CLEAN));
- $fieldparam = strtolower(required_param('field', PARAM_CLEAN));
- $name = substr(trim(strtolower(optional_param('name', $fieldparam, PARAM_CLEAN))),0,30);
+ $tableparam = strtolower(required_param('table', PARAM_PATH));
+ $fieldparam = strtolower(required_param('field', PARAM_PATH));
+ $name = substr(trim(strtolower(optional_param('name', $fieldparam, PARAM_PATH))),0,30);
$comment = required_param('comment', PARAM_CLEAN);
$comment = trim(stripslashes_safe($comment));
$type = required_param('type', PARAM_INT);
- $length = strtolower(optional_param('length', NULL, PARAM_CLEAN));
- $decimals = optional_param('decimals', NULL, PARAM_CLEAN);
+ $length = strtolower(optional_param('length', NULL, PARAM_ALPHANUM));
+ $decimals = optional_param('decimals', NULL, PARAM_INT);
$unsigned = optional_param('unsigned', false, PARAM_BOOL);
$notnull = optional_param('notnull', false, PARAM_BOOL);
$sequence = optional_param('sequence', false, PARAM_BOOL);
$enum = optional_param('enum', false, PARAM_BOOL);
$enumvalues = optional_param('enumvalues', 0, PARAM_CLEAN);
$enumvalues = trim(stripslashes_safe($enumvalues));
- $default = optional_param('default', NULL, PARAM_CLEAN);
+ $default = optional_param('default', NULL, PARAM_PATH);
$default = trim(stripslashes_safe($default));
$editeddir =& $XMLDB->editeddirs[$dirpath];
"<a href=\"../index.php\">" . $this->str['administration'] . "</a> -> <a href=\"index.php\">XMLDB</a>");
notice ('<p>' .implode(', ', $errors) . '</p>
<p>' . $tempfield->readableInfo(),
- 'index.php?action=edit_field&field=' .$field->getName() . '&table=' . $table->getName() . '&dir=' . urlencode($dirpath));
+ 'index.php?action=edit_field&field=' .$field->getName() . '&table=' . $table->getName() . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)));
die; /// re-die :-P
}
/// Do the job, setting result as needed
+ if (!data_submitted('nomatch')) { ///Basic prevention
+ error('Wrong action call');
+ }
+
/// Get parameters
- $dirpath = required_param('dir', PARAM_CLEAN);
- $dirpath = stripslashes_safe($dirpath);
+ $dirpath = required_param('dir', PARAM_PATH);
+ $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
- $tableparam = strtolower(required_param('table', PARAM_CLEAN));
- $indexparam = strtolower(required_param('index', PARAM_CLEAN));
- $name = trim(strtolower(optional_param('name', $indexparam, PARAM_CLEAN)));
+ $tableparam = strtolower(required_param('table', PARAM_PATH));
+ $indexparam = strtolower(required_param('index', PARAM_PATH));
+ $name = trim(strtolower(optional_param('name', $indexparam, PARAM_PATH)));
$comment = required_param('comment', PARAM_CLEAN);
$comment = trim(stripslashes_safe($comment));
"<a href=\"../index.php\">" . $this->str['administration'] . "</a> -> <a href=\"index.php\">XMLDB</a>");
notice ('<p>' .implode(', ', $errors) . '</p>
<p>' . $tempindex->readableInfo(),
- 'index.php?action=edit_index&index=' .$index->getName() . '&table=' . $table->getName() . '&dir=' . urlencode($dirpath));
+ 'index.php?action=edit_index&index=' .$index->getName() . '&table=' . $table->getName() . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)));
die; /// re-die :-P
}
/// Do the job, setting result as needed
+ if (!data_submitted('nomatch')) { ///Basic prevention
+ error('Wrong action call');
+ }
+
/// Get parameters
- $dirpath = required_param('dir', PARAM_CLEAN);
- $dirpath = stripslashes_safe($dirpath);
+ $dirpath = required_param('dir', PARAM_PATH);
+ $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
- $tableparam = strtolower(required_param('table', PARAM_CLEAN));
- $keyparam = strtolower(required_param('key', PARAM_CLEAN));
- $name = trim(strtolower(optional_param('name', $keyparam, PARAM_CLEAN)));
+ $tableparam = strtolower(required_param('table', PARAM_PATH));
+ $keyparam = strtolower(required_param('key', PARAM_PATH));
+ $name = trim(strtolower(optional_param('name', $keyparam, PARAM_PATH)));
$comment = required_param('comment', PARAM_CLEAN);
$comment = trim(stripslashes_safe($comment));
if ($type == XMLDB_KEY_FOREIGN ||
$type == XMLDB_KEY_FOREIGN_UNIQUE) {
- $reftable = trim(strtolower(required_param('reftable', PARAM_CLEAN)));
+ $reftable = trim(strtolower(required_param('reftable', PARAM_PATH)));
$reffields= required_param('reffields', PARAM_CLEAN);
$reffields = str_replace(' ', '', trim(strtolower(stripslashes_safe($reffields))));
}
"<a href=\"../index.php\">" . $this->str['administration'] . "</a> -> <a href=\"index.php\">XMLDB</a>");
notice ('<p>' .implode(', ', $errors) . '</p>
<p>' . $tempkey->readableInfo(),
- 'index.php?action=edit_key&key=' .$key->getName() . '&table=' . $table->getName() . '&dir=' . urlencode($dirpath));
+ 'index.php?action=edit_key&key=' .$key->getName() . '&table=' . $table->getName() . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)));
die; /// re-die :-P
}