Remove spaces at EOL.
Remove spaces at EOL.

File last commit:

8248689dc91e
f4cda9e28354
Show More
notfound.php
27 lines | 1014 B | text/x-php | PhpLexer
<?php
require_once('../frontend.inc.php');
require_once('../admin/include/admin.inc.php');
/* Provide clean data */
if( !preg_match('/(\d{4})\.(\w{3})$/', $_SERVER['REQUEST_URI'], $request) )
term('404 Not Found');
$stripnumber = (int) $strip[0];
$extention = mysql_real_escape_string($request[2]);
/* Determine if the requested strip exists and is published */
$qr = mysqli_query($link, "SELECT strip.id AS id, media_t.extension AS ext
FROM strip JOIN media_t ON strip.media = media_t.id
WHERE strip.id = $stripnumber AND media_t.extension = '$extension' AND strip.published < NOW()");
if(!( $strip = mysqli_fetch_array($qr) ))
term('404 Not Found');
if( @rename(sprintf('restricted/%04d.%s', $strip[0], $strip[1]), sprintf('%04d.%s', $strip[0], $strip[1])) ) {
/* We are the first one to get here, post to Twitter */
twitterpost( urlencode("Comic ".$strip[0]." posted: ".SITE_HOST.SITE_PATH."/strip/".$strip[0]) );
}
header("Location: $_SERVER[REQUEST_URI]");
?>