A preview that fails the captcha or the form token keeps no image. A session keeps one image, the directory has a size limit, and abandoned images go at the next upload.
28 lines
987 B
PHP
28 lines
987 B
PHP
<?php
|
|
$result = get_post_data(TRUE);
|
|
extract($result[0], EXTR_OVERWRITE);
|
|
|
|
echo '<p>Please review your submission. Once you\'ve finished, please click "Submit" at the bottom of the page, or click "Preview" to check it again.</p>';
|
|
|
|
// Keep a new image outside the web root until the story is saved;
|
|
// display.php shows it to this session only. A request that failed the
|
|
// captcha or the form token keeps nothing.
|
|
if (is_uploaded_file($_FILES['upload']['tmp_name'] ?? '') &&
|
|
!isset($validate['upload']) && !isset($validate['captcha']) && !isset($validate['csrf'])) {
|
|
if (store_upload($_FILES['upload']['tmp_name']))
|
|
$file_src = pending_upload_url();
|
|
else
|
|
$validate['upload'] = 'The site cannot keep more images just now. Please try again later.';
|
|
} else if (isset($uploaded) && $uploaded === 'pending' && pending_upload() && !$remove_img) {
|
|
$file_src = pending_upload_url();
|
|
}
|
|
|
|
echo display_stories();
|
|
|
|
echo "<br /><br />\n";
|
|
|
|
include('./write.inc.php');
|
|
|
|
return;
|
|
?>
|