mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 12:11:36 +00:00
Empty commit
This commit is contained in:
parent
68d25e0fbe
commit
f8540013d6
14
api.php
14
api.php
@ -59,17 +59,23 @@ function is_number($Str) {
|
||||
function display_str($Str) {
|
||||
if ($Str != '') {
|
||||
$Str = make_utf8($Str);
|
||||
$Str = mb_convert_encoding($Str,"HTML-ENTITIES","UTF-8");
|
||||
$Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m","&",$Str);
|
||||
$Str = mb_convert_encoding($Str, 'HTML-ENTITIES', 'UTF-8');
|
||||
$Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m", '&', $Str);
|
||||
|
||||
$Replace = array(
|
||||
"'",'"',"<",">",
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ'
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ',
|
||||
'‰','Š','‹','Œ','Ž','‘','’','“',
|
||||
'”','•','–','—','˜','™','š','›',
|
||||
'œ','ž','Ÿ'
|
||||
);
|
||||
|
||||
$With = array(
|
||||
''','"','<','>',
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ'
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ',
|
||||
'‰','Š','‹','Œ','Ž','‘','’','“',
|
||||
'”','•','–','—','˜','™','š','›',
|
||||
'œ','ž','Ÿ'
|
||||
);
|
||||
|
||||
$Str = str_replace($Replace, $With, $Str);
|
||||
|
@ -27,8 +27,13 @@ function check_name($Name) {
|
||||
if (preg_match('/INCOMPLETE~\*/i', $Name)) {
|
||||
forbidden_error($Name);
|
||||
}
|
||||
if (preg_match('/[:?]/', $Name, $Matches)) {
|
||||
character_error($Matches[0]);
|
||||
// Disallow the following characters, which are invalid in NTFS on Windows systems.
|
||||
// : ? / < > \ * | "
|
||||
$AllBlockedChars = ' : ? / < > \ * | " ';
|
||||
// Only the following characters need to be escaped:
|
||||
// \ - ^ ]
|
||||
if (preg_match('/[\/\\:?<>*|"]*/', $Name, $Matches)) {
|
||||
character_error($Matches[0], $AllBlockedChars);
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,8 +43,7 @@ function check_extensions($Type, $Name) {
|
||||
if (!isset($MusicExtensions[get_file_extension($Name)])) {
|
||||
invalid_error($Name);
|
||||
}
|
||||
}
|
||||
elseif ($Type == 'Comics') {
|
||||
} elseif ($Type == 'Comics') {
|
||||
if (!isset($ComicsExtensions[get_file_extension($Name)])) {
|
||||
invalid_error($Name);
|
||||
}
|
||||
@ -60,7 +64,7 @@ function forbidden_error($Name) {
|
||||
$Err = 'The torrent contained one or more forbidden files (' . display_str($Name) . ')';
|
||||
}
|
||||
|
||||
function character_error($Character) {
|
||||
function character_error($Character, $AllBlockedChars) {
|
||||
global $Err;
|
||||
$Err = "One or more of the files in the torrent has a name that contains the forbidden character '$Character'. Please rename the files as necessary and recreate the torrent.";
|
||||
$Err = "One or more of the files in the torrent has a name that contains the forbidden character '$Character'. Please rename the files as necessary and recreate the torrent.\n\nNote: The complete list of characters that are disallowed are shown below:\n\n\t$AllBlockedChars";
|
||||
}
|
||||
|
@ -916,8 +916,12 @@ private function smileys ($Str) {
|
||||
/*
|
||||
|
||||
// Uncomment this part to test the class via command line:
|
||||
function display_str($Str) {return $Str;}
|
||||
function check_perms($Perm) {return true;}
|
||||
function display_str($Str) {
|
||||
return $Str;
|
||||
}
|
||||
function check_perms($Perm) {
|
||||
return true;
|
||||
}
|
||||
$Str = "hello
|
||||
[pre]http://anonym.to/?http://whatshirts.portmerch.com/
|
||||
====hi====
|
||||
|
41
feeds.php
41
feeds.php
@ -23,25 +23,33 @@ function check_perms() {
|
||||
}
|
||||
|
||||
function is_number($Str) {
|
||||
if ($Str < 0) { return false; }
|
||||
if ($Str < 0) {
|
||||
return false;
|
||||
}
|
||||
// We're converting input to a int, then string and comparing to original
|
||||
return ($Str == strval(intval($Str)) ? true : false);
|
||||
}
|
||||
|
||||
function display_str($Str) {
|
||||
if ($Str!="") {
|
||||
if ($Str != '') {
|
||||
$Str = make_utf8($Str);
|
||||
$Str=mb_convert_encoding($Str,"HTML-ENTITIES","UTF-8");
|
||||
$Str=preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m","&",$Str);
|
||||
$Str = mb_convert_encoding($Str, 'HTML-ENTITIES', 'UTF-8');
|
||||
$Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m", '&', $Str);
|
||||
|
||||
$Replace = array(
|
||||
"'",'"',"<",">",
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ'
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ',
|
||||
'‰','Š','‹','Œ','Ž','‘','’','“',
|
||||
'”','•','–','—','˜','™','š','›',
|
||||
'œ','ž','Ÿ'
|
||||
);
|
||||
|
||||
$With = array(
|
||||
''','"','<','>',
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ'
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ',
|
||||
'‰','Š','‹','Œ','Ž','‘','’','“',
|
||||
'”','•','–','—','˜','™','š','›',
|
||||
'œ','ž','Ÿ'
|
||||
);
|
||||
|
||||
$Str = str_replace($Replace, $With, $Str);
|
||||
@ -50,12 +58,21 @@ function display_str($Str) {
|
||||
}
|
||||
|
||||
function make_utf8($Str) {
|
||||
if ($Str!="") {
|
||||
if (is_utf8($Str)) { $Encoding="UTF-8"; }
|
||||
if (empty($Encoding)) { $Encoding=mb_detect_encoding($Str,'UTF-8, ISO-8859-1'); }
|
||||
if (empty($Encoding)) { $Encoding="ISO-8859-1"; }
|
||||
if ($Encoding=="UTF-8") { return $Str; }
|
||||
else { return @mb_convert_encoding($Str,"UTF-8",$Encoding); }
|
||||
if ($Str != '') {
|
||||
if (is_utf8($Str)) {
|
||||
$Encoding = 'UTF-8';
|
||||
}
|
||||
if (empty($Encoding)) {
|
||||
$Encoding = mb_detect_encoding($Str, 'UTF-8, ISO-8859-1');
|
||||
}
|
||||
if (empty($Encoding)) {
|
||||
$Encoding = 'ISO-8859-1';
|
||||
}
|
||||
if ($Encoding == 'UTF-8') {
|
||||
return $Str;
|
||||
} else {
|
||||
return @mb_convert_encoding($Str, 'UTF-8', $Encoding);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
28
image.php
28
image.php
@ -32,9 +32,9 @@
|
||||
$LoginCookie = $Enc->decrypt($_COOKIE['session']);
|
||||
}
|
||||
if (isset($LoginCookie)) {
|
||||
list($SessionID, $UserID) = explode("|~|",$Enc->decrypt($LoginCookie));
|
||||
list($SessionID, $UserID) = explode('|~|', $Enc->decrypt($LoginCookie));
|
||||
$UserID = (int)$UserID;
|
||||
$UserInfo = $Cache->get_value('user_info_'.$UserID);
|
||||
$UserInfo = $Cache->get_value("user_info_$UserID");
|
||||
$Permissions = $Cache->get_value('perm_'.$UserInfo['PermissionID']);
|
||||
}
|
||||
|
||||
@ -108,10 +108,12 @@ function image_height($Type, $Data) {
|
||||
$Str []= "Started 4, + ".$Block['Length'];
|
||||
while ($Data != '') { // iterate through the blocks until we find the start of frame marker (FFC0)
|
||||
$Block = unpack('CBlock/CType/nLength', $Data); // Get info about the block
|
||||
if ($Block['Block'] != '255') { break; } // We should be at the start of a new block
|
||||
if ($Block['Block'] != '255') { // We should be at the start of a new block
|
||||
break;
|
||||
}
|
||||
if ($Block['Type'] != '192') { // C0
|
||||
$Data = substr($Data, $Block['Length'] + 2); // Next block
|
||||
$Str []= "Started ".$i.", + ".($Block['Length'] + 2);
|
||||
$Str []= "Started $i, + ".($Block['Length'] + 2);
|
||||
$i += ($Block['Length'] + 2);
|
||||
} else { // We're at the FFC0 block
|
||||
$Data = substr($Data, 5); // Skip FF C0 Length(2) precision(1)
|
||||
@ -196,10 +198,10 @@ function send_pm($ToID, $FromID, $Subject, $Body, $ConvID = '') {
|
||||
AND UserID = '$ToID'
|
||||
AND InInbox = '1'");
|
||||
list($UnRead) = $DB->next_record(MYSQLI_BOTH, FALSE);
|
||||
$Cache->cache_value('inbox_new_'.$ToID, $UnRead);
|
||||
$Cache->cache_value("inbox_new_$ToID", $UnRead);
|
||||
|
||||
//if ($UnRead == 0) {
|
||||
// $Cache->increment('inbox_new_'.$ToID);
|
||||
// $Cache->increment("inbox_new_$ToID");
|
||||
//}
|
||||
return $ConvID;
|
||||
}
|
||||
@ -216,17 +218,23 @@ function display_str($Str) {
|
||||
}
|
||||
if ($Str != '' && !is_number($Str)) {
|
||||
$Str = make_utf8($Str);
|
||||
$Str = mb_convert_encoding($Str,"HTML-ENTITIES","UTF-8");
|
||||
$Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m","&",$Str);
|
||||
$Str = mb_convert_encoding($Str, 'HTML-ENTITIES', 'UTF-8');
|
||||
$Str = preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/m", '&', $Str);
|
||||
|
||||
$Replace = array(
|
||||
"'",'"',"<",">",
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ'
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ',
|
||||
'‰','Š','‹','Œ','Ž','‘','’','“',
|
||||
'”','•','–','—','˜','™','š','›',
|
||||
'œ','ž','Ÿ'
|
||||
);
|
||||
|
||||
$With = array(
|
||||
''','"','<','>',
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ','‰','Š','‹','Œ','Ž','‘','’','“','”','•','–','—','˜','™','š','›','œ','ž','Ÿ'
|
||||
'€','‚','ƒ','„','…','†','‡','ˆ',
|
||||
'‰','Š','‹','Œ','Ž','‘','’','“',
|
||||
'”','•','–','—','˜','™','š','›',
|
||||
'œ','ž','Ÿ'
|
||||
);
|
||||
|
||||
$Str = str_replace($Replace, $With, $Str);
|
||||
|
@ -142,7 +142,7 @@
|
||||
<div class="head"><strong>Stats</strong></div>
|
||||
<ul class="stats nobullet">
|
||||
<li>Artists: <?=number_format($NumArtists)?></li>
|
||||
<li>Subscribers: <?=number_format(count($Subscribers))?></li>
|
||||
<li>Subscribers: <?=number_format((int)$Subscribers)?></li>
|
||||
<li>Built by <?=number_format(count($Users))?> user<?=(count($Users) > 1 ? 's' : '')?></li>
|
||||
<li>Last updated: <?=time_diff($Updated)?></li>
|
||||
</ul>
|
||||
@ -288,5 +288,5 @@
|
||||
<?
|
||||
View::show_footer();
|
||||
|
||||
$Cache->cache_value('collage_'.$CollageID, array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser)), 3600);
|
||||
$Cache->cache_value('collage_'.$CollageID, array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)), 3600);
|
||||
?>
|
||||
|
@ -385,7 +385,7 @@
|
||||
<? if (!empty($TopArtists)) { ?>
|
||||
<li>Artists: <?=number_format(count($TopArtists))?></li>
|
||||
<? } ?>
|
||||
<li>Subscribers: <?=number_format(count($Subscribers))?></li>
|
||||
<li>Subscribers: <?=number_format((int)$Subscribers)?></li>
|
||||
<li>Built by <?=number_format(count($Users))?> user<?=(count($Users) > 1 ? 's' : '')?></li>
|
||||
<li>Last updated: <?=time_diff($Updated)?></li>
|
||||
</ul>
|
||||
@ -569,5 +569,5 @@
|
||||
<?
|
||||
View::show_footer();
|
||||
|
||||
$Cache->cache_value('collage_'.$CollageID, array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser)), 3600);
|
||||
$Cache->cache_value('collage_'.$CollageID, array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser, $Updated, $Subscribers)), 3600);
|
||||
?>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<h3 id="forums">Donation Complete</h3>
|
||||
</div>
|
||||
<div class="box pad" style="padding: 10px 10px 10px 20px;">
|
||||
<p>Thank you for your donation! If this is your first time donating you will now have received 2 invitations and a <img src="<?=(STATIC_SERVER)?>common/symbols/donor.png" alt="Donor" />.</p>
|
||||
<p>Thank you for your donation! If this is your first time donating, you will have received two (2) invitations and a <img src="<?=(STATIC_SERVER)?>common/symbols/donor.png" alt="Donor" />.</p>
|
||||
</div>
|
||||
</div>
|
||||
<? View::show_footer();?>
|
||||
|
@ -783,7 +783,7 @@ function filelist($Str) {
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
$Collages = $Cache->get_value('torrent_collages_'.$GroupID);
|
||||
$Collages = $Cache->get_value("torrent_collages_$GroupID");
|
||||
if (!is_array($Collages)) {
|
||||
$DB->query("
|
||||
SELECT c.Name, c.NumTorrents, c.ID
|
||||
@ -833,7 +833,7 @@ function filelist($Str) {
|
||||
<?
|
||||
}
|
||||
|
||||
$PersonalCollages = $Cache->get_value('torrent_collages_personal_'.$GroupID);
|
||||
$PersonalCollages = $Cache->get_value("torrent_collages_personal_$GroupID");
|
||||
if (!is_array($PersonalCollages)) {
|
||||
$DB->query("
|
||||
SELECT c.Name, c.NumTorrents, c.ID
|
||||
@ -843,7 +843,7 @@ function filelist($Str) {
|
||||
AND Deleted = '0'
|
||||
AND CategoryID = '0'");
|
||||
$PersonalCollages = $DB->to_array(false, MYSQLI_NUM);
|
||||
$Cache->cache_value('torrent_collages_personal_'.$GroupID, $PersonalCollages, 3600 * 6);
|
||||
$Cache->cache_value("torrent_collages_personal_$GroupID", $PersonalCollages, 3600 * 6);
|
||||
}
|
||||
|
||||
if (count($PersonalCollages) > 0) {
|
||||
@ -894,14 +894,14 @@ function filelist($Str) {
|
||||
// --- Comments ---
|
||||
|
||||
// gets the amount of comments for this group
|
||||
$Results = $Cache->get_value('torrent_comments_'.$GroupID);
|
||||
$Results = $Cache->get_value("torrent_comments_$GroupID");
|
||||
if ($Results === false) {
|
||||
$DB->query("
|
||||
SELECT COUNT(c.ID)
|
||||
FROM torrents_comments as c
|
||||
WHERE c.GroupID = '$GroupID'");
|
||||
list($Results) = $DB->next_record();
|
||||
$Cache->cache_value('torrent_comments_'.$GroupID, $Results, 0);
|
||||
$Cache->cache_value("torrent_comments_$GroupID", $Results, 0);
|
||||
}
|
||||
|
||||
if (isset($_GET['postid']) && is_number($_GET['postid']) && $Results > TORRENT_COMMENTS_PER_PAGE) {
|
||||
@ -923,7 +923,7 @@ function filelist($Str) {
|
||||
//---------- Get some data to start processing
|
||||
|
||||
// Cache catalogue from which the page is selected, allows block caches and future ability to specify posts per page
|
||||
$Catalogue = $Cache->get_value('torrent_comments_'.$GroupID.'_catalogue_'.$CatalogueID);
|
||||
$Catalogue = $Cache->get_value("torrent_comments_{$GroupID}_catalogue_$CatalogueID");
|
||||
if ($Catalogue === false) {
|
||||
$DB->query("
|
||||
SELECT
|
||||
@ -940,7 +940,7 @@ function filelist($Str) {
|
||||
ORDER BY c.ID
|
||||
LIMIT $CatalogueLimit");
|
||||
$Catalogue = $DB->to_array(false, MYSQLI_ASSOC);
|
||||
$Cache->cache_value('torrent_comments_'.$GroupID.'_catalogue_'.$CatalogueID, $Catalogue, 0);
|
||||
$Cache->cache_value("torrent_comments_{$GroupID}_catalogue_$CatalogueID", $Catalogue, 0);
|
||||
}
|
||||
|
||||
//This is a hybrid to reduce the catalogue down to the page elements: We use the page limit % catalogue
|
||||
|
@ -111,6 +111,8 @@
|
||||
$DB->query("DELETE FROM collages_torrents WHERE GroupID='$OldGroupID' AND CollageID='$CollageID'");
|
||||
$Cache->delete_value('collage_'.$CollageID);
|
||||
}
|
||||
$Cache->delete_value('torrent_collages_'.$NewGroupID);
|
||||
$Cache->delete_value('torrent_collages_personal_'.$NewGroupID);
|
||||
|
||||
//Requests
|
||||
$DB->query("SELECT ID FROM requests WHERE GroupID='$OldGroupID'");
|
||||
|
@ -35,9 +35,10 @@
|
||||
$Name .= $GroupName;
|
||||
|
||||
$DB->query("
|
||||
SELECT uid, tstamp
|
||||
SELECT uid, MAX(tstamp) AS tstamp
|
||||
FROM xbt_snatched
|
||||
WHERE fid='$TorrentID'
|
||||
GROUP BY uid
|
||||
ORDER BY tstamp DESC
|
||||
LIMIT 10");
|
||||
if ($DB->record_count() > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user