예제 #1
0
            break;
        case UPLOAD_ERR_INI_SIZE:
        case UPLOAD_ERR_FORM_SIZE:
            $result = false;
            $int_error = $validator->_error(8, validator::FILE_LIMIT);
            break;
        case UPLOAD_ERR_PARTIAL:
        case UPLOAD_ERR_NO_TMP_DIR:
        case UPLOAD_ERR_CANT_WRITE:
            $result = false;
            $int_error = $validator->_error(9);
            break;
    }
    /* URL validator */
} else {
    $result = $validator->parse_url((string) $_REQUEST['url']);
}
/* no fatal errors. continue */
if ($result) {
    if ($validator->internal_error()) {
        echo "<p>{$message['13']}:<br />\n";
        echo nl2br($validator->internal_errors_string()) . "</p>\n";
    }
    echo '<p>';
    /* file upload */
    if (isset($_FILES['file']) && $_FILES['file']['error'] == UPLOAD_ERR_OK) {
        echo isset($_FILES['file']['name']) ? "<strong>{$message['18']}</strong>: {$_FILES['file']['name']}<br />\n" : '';
        /* URL validator */
    } else {
        echo '<strong>URL</strong>: ' . htmlspecialchars($_REQUEST['url'], ENT_QUOTES, 'UTF-8') . "<br />\n";
    }