Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 20 additions and 11 deletions.
  1. +7 −1 lib/snippets.php
  2. +3 −2 pages/calendar.php
  3. +10 −8 pages/memberlist.php
View
8 lib/snippets.php
@@ -254,7 +254,7 @@ function Report($stuff, $hidden = 0, $severity = 0)
$req = 'NULL';
Query("insert into reports (ip,user,time,text,hidden,severity,request)
- values ('".$_SERVER['REMOTE_ADDR']."', ".(int)(isset($loguserid) ? $loguserid : 0).", ".time().", '".justEscape(str_replace("#HERE#", $here, $stuff))."', ".$hidden.", ".$severity.", ".$req.")");
+ values ('".$_SERVER['REMOTE_ADDR']."', ".(int)issetor($loguserid, 0).", ".time().", '".justEscape(str_replace("#HERE#", $here, $stuff))."', ".$hidden.", ".$severity.", ".$req.")");
Query("delete from reports where time < ".(time() - (60*60*24*30)));
}
@@ -339,6 +339,7 @@ function makeThemeArrays()
function getUserKey()
{
+ global $loguserid, $loguser, $salt;
return hash('sha256', "{$loguserid},{$loguser['pss']},{$salt}");
}
@@ -373,4 +374,9 @@ function endsWith($haystack, $needle)
$start = $length * -1; //negative
return (substr($haystack, $start) === $needle);
}
+
+function issetor(&$value, $or = null)
+{
+ return $value === null ? $or : $value;
+}
?>
View
5 pages/calendar.php
@@ -9,7 +9,7 @@
$month = $now['mon'];
$day = $now['mday'];
-if((int)$_GET['month'])
+if((int)issetor($_GET['month']))
{
$month = (int)$_GET['month'];
$day = 0;
@@ -35,6 +35,7 @@
}
$cellClass = 0;
+$grid = '';
while($i <= $max)
{
$grid .= format(
@@ -50,7 +51,7 @@
$label = format(
"
{0}
- {1}", $dd, $cells[$dd]);
+ {1}", $dd, issetor($cells[$dd], ''));
$grid .= format(
"
<td class=\"cell{2} smallFonts\" style=\"height: 80px; vertical-align: top;\">
View
18 pages/memberlist.php
@@ -7,8 +7,9 @@
AssertForbidden("viewMembers");
-$tpp = $loguser['threadsperpage'];
-if($tpp<1) $tpp=50;
+$tpp = issetor($loguser['threadsperpage'], 50);
+if($tpp < 1)
+ $tpp=50;
if(isset($_GET['from']))
$from = (int)$_GET['from'];
@@ -23,11 +24,11 @@
unset($dir);
}
-$sort = $_GET['sort'];
+$sort = issetor($_GET['sort'], '');
if(!in_array($sort, array('', 'id', 'name', 'karma', 'reg')))
- unset($sort);
+ $sort = '';
-$sex = $_GET['sex'];
+$sex = issetor($_GET['sex']);
if(isset($_GET['pow']) && $_GET['pow'] != "")
$pow = (int)$_GET['pow'];
if(isset($_GET['letter']) && is_string($_GET['letter']))
@@ -74,9 +75,9 @@
$qUsers = "select * from users where ".$where." order by ".$order.", name asc limit ".$from.", ".$tpp;
$rUsers = Query($qUsers);
-$pagelinks = PageLinks(actionLink("memberlist", "", mlink2($sort,$sex,$pow,$tpp,$letter,$dir)."&from="), $tpp, $from, $numUsers);
+$pagelinks = PageLinks(actionLink("memberlist", "", mlink2($sort,$sex,issetor($pow),$tpp,$letter,issetor($dir))."&from="), $tpp, $from, $numUsers);
-$alphabet .= "<li>".mlink($sort,$sex,$pow,$tpp,"%23",$dir)."#</a></li>\n";
+$alphabet = "<li>".mlink($sort,$sex,$pow,$tpp,"%23",$dir)."#</a></li>\n";
for($l = 0; $l < 26; $l++)
{
$let = chr(65+$l);
@@ -248,6 +249,7 @@
$memberList = "";
if($numUsers)
{
+ $cellClass = 0;
while($user = Fetch($rUsers))
{
$bucket = "userMangler"; include("./lib/pluginloader.php");
@@ -255,7 +257,7 @@
$user['average'] = sprintf("%1.02f", $user['posts'] / $daysKnown);
$userPic = "";
- if($user['picture'] && $hacks['themenames'] != 3)
+ if($user['picture'])
$userPic = "<img src=\"".str_replace("img/avatars/", "img/avatars/", $user['picture'])."\" alt=\"\" style=\"width: 60px;\" />";
$cellClass = ($cellClass+1) % 2;

No commit comments for this range

Something went wrong with that request. Please try again.