mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
Converted double quote strings to single quote literals - inspired by error in double quotes found by ottenhoff and noted in comment to bug 1981
This commit is contained in:
parent
bdcc6a222a
commit
70e728fbbc
@ -3,23 +3,23 @@
|
||||
// Deletes the moodledata directory, COMPLETELY!!
|
||||
// BE VERY CAREFUL USING THIS!
|
||||
|
||||
require_once("../config.php");
|
||||
require_once('../config.php');
|
||||
|
||||
require_login();
|
||||
|
||||
if (!isadmin()) {
|
||||
error("You must be admin to use this script!");
|
||||
error('You must be admin to use this script!');
|
||||
}
|
||||
|
||||
$deletedir = $CFG->dataroot; // The directory to delete!
|
||||
|
||||
if (!$sure) {
|
||||
notice_yesno ("Are you completely sure you want to delete everything inside the directory $deletedir ?", "delete.php?sure=yes", "index.php");
|
||||
notice_yesno ('Are you completely sure you want to delete everything inside the directory '. $deletedir .' ?', 'delete.php?sure=yes', 'index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$reallysure) {
|
||||
notice_yesno ("Are you REALLY REALLY completely sure you want to delete everything inside the directory $deletedir (this includes all user images, and any other course files that have been created) ?", "delete.php?sure=yes&reallysure=yes", "index.php");
|
||||
notice_yesno ('Are you REALLY REALLY completely sure you want to delete everything inside the directory '. $deletedir .' (this includes all user images, and any other course files that have been created) ?', 'delete.php?sure=yes&reallysure=yes', 'index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
delete_subdirectories($deletedir);
|
||||
|
||||
echo "<h1 align="center">Done!</h1>";
|
||||
echo '<h1 align="center">Done!</h1>';
|
||||
print_continue($CFG->wwwroot);
|
||||
exit;
|
||||
|
||||
@ -37,22 +37,22 @@ function delete_subdirectories($rootdir) {
|
||||
$dir = opendir($rootdir);
|
||||
|
||||
while ($file = readdir($dir)) {
|
||||
if ($file != "." and $file != "..") {
|
||||
$fullfile = "$rootdir/$file";
|
||||
if (filetype($fullfile) == "dir") {
|
||||
if ($file != '.' and $file != '..') {
|
||||
$fullfile = $rootdir .'/'. $file;
|
||||
if (filetype($fullfile) == 'dir') {
|
||||
delete_subdirectories($fullfile);
|
||||
echo "Deleting $fullfile ... ";
|
||||
echo 'Deleting '. $fullfile .' ... ';
|
||||
if (rmdir($fullfile)) {
|
||||
echo "Done.<br />";
|
||||
echo 'Done.<br />';
|
||||
} else {
|
||||
echo "FAILED.<br />";
|
||||
echo 'FAILED.<br />';
|
||||
}
|
||||
} else {
|
||||
echo "Deleting $fullfile ... ";
|
||||
if (unlink("$fullfile")) {
|
||||
echo "Done.<br />";
|
||||
echo 'Deleting '. $fullfile .' ... ';
|
||||
if (unlink($fullfile)) {
|
||||
echo 'Done.<br />';
|
||||
} else {
|
||||
echo "FAILED.<br />";
|
||||
echo 'FAILED.<br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -60,4 +60,4 @@ function delete_subdirectories($rootdir) {
|
||||
closedir($dir);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
@ -1,23 +1,23 @@
|
||||
<?PHP // $Id$
|
||||
|
||||
require("../config.php");
|
||||
require('../config.php');
|
||||
|
||||
if (isset($text)) { // form submitted
|
||||
if (!$admin = get_admin() ) {
|
||||
error("Could not find the admin user to mail to!");
|
||||
error('Could not find the admin user to mail to!');
|
||||
}
|
||||
|
||||
email_to_user($admin, $USER, "Error: $referer -> $requested", "$text");
|
||||
email_to_user($admin, $USER, 'Error: '. $referer .' -> '. $requested, $text);
|
||||
|
||||
redirect("$CFG->wwwroot/course/", "Message sent, thanks", 3);
|
||||
redirect($CFG->wwwroot .'/course/', 'Message sent, thanks', 3);
|
||||
die;
|
||||
}
|
||||
|
||||
$site = get_site();
|
||||
|
||||
print_header("$site->fullname:Error", "$site->fullname: Error 404", "", "form.text");
|
||||
print_header($site->fullname .':Error', $site->fullname .': Error 404', '', 'form.text');
|
||||
|
||||
print_simple_box("An unusual error occurred (tried to reach a page that doesn't exist).<p align="center">$REDIRECT_URL", "center", "", "$THEME->cellheading");
|
||||
print_simple_box('An unusual error occurred (tried to reach a page that doesn\'t exist).<p align="center">'. $REDIRECT_URL, 'center', '', $THEME->cellheading);
|
||||
|
||||
?>
|
||||
|
||||
@ -34,4 +34,4 @@
|
||||
|
||||
print_footer();
|
||||
|
||||
?>
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user