File: /home/httpd/html/baretube.com.new/admin/functions.bugfix.php
<?
//NEVER EDIT THIS FILE!//
//Why is this file here instead of just patching bits of code? Sometimes we need to change something that effects in a file that is often edited by users - such as inc.seo.php, which would make it difficult for people to update. This is messy, but no other way around it.
if($_REQUEST['mode'] == 'my-uploads') {
$_REQUEST['mode'] = 'my_uploads';
$_GET['mode'] = 'my_uploads';
}
if($_REQUEST['sortby'] == 'longest') {
$_REQUEST['sortby'] = 'length';
$_GET['sortby'] = 'length';
}
/**
* file_crc - Return crc32 value of a file
*
* @param [in] $file File path
* @return crc32 value
*
*/
function file_crc($file) {
$file_string = file_get_contents($file);
$crc = crc32($file_string);
return sprintf("%u", $crc);
}
/**
* _mogrifyImageThumbnail - Runs image through mogrify comand line
*
* @param [in] $input Input File
* @param [in] $thumbwidth Thumbnail Width in pixels
* @param [in] $thumbheight Thumbnail height in pixels
* @return void
*
*/
function _mogrifyImageThumbnail($input, $thumbwidth, $thumbheight) {
global $mogrify_path;
$input = escapeshellcmd($input);
shell_exec("$mogrify_path -adaptive-resize ".($thumbwidth)."x".($thumbheight)."^ -gravity Center -extent ".$thumbwidth."x".$thumbheight." \"$input\"");
}
if(stripos($_SERVER['REQUEST_URI'],'includes/ajax.login.php') !== false) {
header('HTTP/1.0 403 Forbidden');
exit();
}
if(stripos($_SERVER['REQUEST_URI'],'includes/ajax.signup.php') !== false) {
header('HTTP/1.0 403 Forbidden');
exit();
}
if($_GET['q']) {
$_GET['q'] = htmlspecialchars($_GET['q'], ENT_QUOTES, "UTF-8");
}
if($_GET['option']) {
$_GET['option'] = htmlentities($_GET['option']);
}