/// 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);
$statementparam = required_param('statement', PARAM_CLEAN);
- $sentenceparam = required_param('sentence', PARAM_CLEAN);
+ $sentenceparam = required_param('sentence', PARAM_INT);
$confirmed = optional_param('confirmed', false, PARAM_BOOL);
$o.= ' <p align="center">' . $this->str['confirmdeletesentence'] . '</p>';
$o.= ' <table align="center" cellpadding="20"><tr><td>';
$o.= ' <div class="singlebutton">';
- $o.= ' <form action="index.php?action=delete_sentence&confirmed=yes&postaction=edit_statement&sentence=' . $sentenceparam . '&statement=' . urlencode($statementparam) . '&dir=' . urlencode($dirpath) . '" method="post">';
+ $o.= ' <form action="index.php?action=delete_sentence&confirmed=yes&postaction=edit_statement&sentence=' . $sentenceparam . '&statement=' . urlencode($statementparam) . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '" method="post">';
$o.= ' <input type="submit" value="'. $this->str['yes'] .'" /></form></div>';
$o.= ' </td><td>';
$o.= ' <div class="singlebutton">';
- $o.= ' <form action="index.php?action=edit_statement&statement=' . urlencode($statementparam) . '&dir=' . urlencode($dirpath) . '" method="post">';
+ $o.= ' <form action="index.php?action=edit_statement&statement=' . urlencode($statementparam) . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '" method="post">';
$o.= ' <input type="submit" value="'. $this->str['no'] .'" /></form></div>';
$o.= ' </td></tr>';
$o.= ' </table>';
/// 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)) {
/// Add the main form
$o = '<form name="form" id="form" action="index.php" method="post">';
- $o.= ' <input type="hidden" name ="dir" value="' . $dirpath . '" />';
+ $o.= ' <input type="hidden" name ="dir" value="' . str_replace($CFG->dirroot, '', $dirpath) . '" />';
$o.= ' <input type="hidden" name ="statement" value="' . $statementparam .'" />';
$o.= ' <input type="hidden" name ="sentence" value="' . $sentenceparam .'" />';
$o.= ' <input type="hidden" name ="action" value="edit_sentence_save" />';
/// Calculate the buttons
$b = ' <p align="center" class="buttons">';
/// The back to edit statement button
- $b .= ' <a href="index.php?action=edit_statement&statement=' . urlencode($statementparam) . '&dir=' . urlencode($dirpath) . '">[' . $this->str['back'] . ']</a>';
+ $b .= ' <a href="index.php?action=edit_statement&statement=' . urlencode($statementparam) . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '">[' . $this->str['back'] . ']</a>';
$b .= '</p>';
$o .= $b;
/// Do the job, setting result as needed
/// Get parameters
- $dirpath = required_param('dir', PARAM_CLEAN);
- $dirpath = stripslashes_safe($dirpath);
+ $dirpath = required_param('dir', PARAM_PATH);
+ $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
$statementparam = strtolower(required_param('statement', PARAM_CLEAN));
- $sentenceparam = strtolower(required_param('sentence', PARAM_CLEAN));
+ $sentenceparam = strtolower(required_param('sentence', PARAM_ALPHANUM));
$fields = required_param('fields', PARAM_CLEAN);
$fields = trim(stripslashes_safe($fields));
"<a href=\"../index.php\">" . $this->str['administration'] . "</a> -> <a href=\"index.php\">XMLDB</a>");
notice ('<p>' .implode(', ', $errors) . '</p>
<p>' . s($sentence),
- 'index.php?action=edit_sentence&sentence=' .$sentenceparam . '&statement=' . urlencode($statementparam) . '&dir=' . urlencode($dirpath));
+ 'index.php?action=edit_sentence&sentence=' .$sentenceparam . '&statement=' . urlencode($statementparam) . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)));
die; /// re-die :-P
}
/// Do the job, setting result as needed
/// Get parameters
- $dirpath = required_param('dir', PARAM_CLEAN);
- $dirpath = stripslashes_safe($dirpath);
+ $dirpath = required_param('dir', PARAM_PATH);
+ $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
$statementparam = strtolower(required_param('statement', PARAM_CLEAN));
$name = trim(strtolower(required_param('name', PARAM_CLEAN)));
/// 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)) {
/// 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 original dir and delete some elements
if (!empty($XMLDB->dbdirs)) {