コード例 #1
0
ファイル: weblib.php プロジェクト: JackCanada/moodle-hacks
/**
 * Extracts arguments from "/foo/bar/something"
 * eg http://mysite.com/script.php/foo/bar/something
 *
 * @param string $string ?
 * @param int $i ?
 * @return array|string
 * @todo Finish documenting this function
 */
function parse_slash_arguments($string, $i = 0)
{
    if (detect_munged_arguments($string)) {
        return false;
    }
    $args = explode('/', $string);
    if ($i) {
        // return just the required argument
        return $args[$i];
    } else {
        // return the whole array
        array_shift($args);
        // get rid of the empty first one
        return $args;
    }
}
コード例 #2
0
ファイル: coursefiles.php プロジェクト: r007/PMoodle
function setfilelist($VARS)
{
    global $USER;
    $USER->filelist = array();
    $USER->fileop = "";
    $count = 0;
    foreach ($VARS as $key => $val) {
        if (substr($key, 0, 4) == "file") {
            $count++;
            $val = rawurldecode($val);
            if (!detect_munged_arguments($val, 0)) {
                $USER->filelist[] = $val;
            }
        }
    }
    return $count;
}
コード例 #3
0
        -->
        </style>
        </head>
        <body onload="reset_value();">

        <?php 
}
$baseweb = $CFG->wwwroot;
if (!($basedir = make_upload_directory("netpublish_images/{$id}"))) {
    error("The site administrator needs to fix the file permissions");
}
//  End of configuration and access control
if (!$wdir) {
    $wdir = "/";
}
if ($wdir != '/' and detect_munged_arguments($wdir, 0) or $file != '' and detect_munged_arguments($file, 0)) {
    $message = "Error: Directories can not contain \"..\"";
    $wdir = "/";
    $action = "";
}
// ARRRGHHHH &%¤%¤%?###
$CFG->framename = 'ibrowser';
switch ($action) {
    case "upload":
        html_header($course, $wdir);
        require_once $CFG->dirroot . '/lib/uploadlib.php';
        if (!empty($save) and confirm_sesskey()) {
            $um = new upload_manager('userfile', false, false, $course, false, 0);
            $dir = "{$basedir}/tmp";
            if ($um->process_file_uploads($dir)) {
                // copy and resize file to its real