New errata corrections
This commit is contained in:
@@ -46,16 +46,21 @@
|
|||||||
function sanitizeString($var)
|
function sanitizeString($var)
|
||||||
{
|
{
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
$var = strip_tags($var);
|
$var = strip_tags($var);
|
||||||
$var = htmlentities($var);
|
$var = htmlentities($var);
|
||||||
|
|
||||||
if (get_magic_quotes_gpc())
|
if (get_magic_quotes_gpc())
|
||||||
$var = stripslashes($var);
|
$var = stripslashes($var);
|
||||||
|
|
||||||
$result = $pdo->quote($var); // This adds single quotes
|
$result = $pdo->quote($var); // This adds single quotes
|
||||||
return str_replace("'", "", $result); // So now remove them
|
return str_replace("'", "", $result); // So now remove them
|
||||||
}
|
}
|
||||||
|
|
||||||
function showProfile($user)
|
function showProfile($user)
|
||||||
{
|
{
|
||||||
|
global $pdo;
|
||||||
|
|
||||||
if (file_exists("$user.jpg"))
|
if (file_exists("$user.jpg"))
|
||||||
echo "<img src='$user.jpg' style='float:left;'>";
|
echo "<img src='$user.jpg' style='float:left;'>";
|
||||||
|
|
||||||
|
|||||||
@@ -27,16 +27,20 @@
|
|||||||
|
|
||||||
$result = queryMysql("SELECT * FROM friends WHERE user='$view'");
|
$result = queryMysql("SELECT * FROM friends WHERE user='$view'");
|
||||||
|
|
||||||
|
$j = 0;
|
||||||
|
|
||||||
while ($row = $result->fetch())
|
while ($row = $result->fetch())
|
||||||
{
|
{
|
||||||
$followers[$j] = $row['friend'];
|
$followers[$j++] = $row['friend'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = queryMysql("SELECT * FROM friends WHERE friend='$view'");
|
$result = queryMysql("SELECT * FROM friends WHERE friend='$view'");
|
||||||
|
|
||||||
|
$j = 0;
|
||||||
|
|
||||||
while ($row = $result->fetch())
|
while ($row = $result->fetch())
|
||||||
{
|
{
|
||||||
$following[$j] = $row['user'];
|
$following[$j++] = $row['user'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$mutual = array_intersect($followers, $following);
|
$mutual = array_intersect($followers, $following);
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ _END;
|
|||||||
|
|
||||||
$query = "SELECT * FROM messages WHERE recip='$view' ORDER BY time DESC";
|
$query = "SELECT * FROM messages WHERE recip='$view' ORDER BY time DESC";
|
||||||
$result = queryMysql($query);
|
$result = queryMysql($query);
|
||||||
|
$num = $result->rowCount();
|
||||||
|
|
||||||
while ($row = $result->fetch())
|
while ($row = $result->fetch())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,16 +27,20 @@
|
|||||||
|
|
||||||
$result = queryMysql("SELECT * FROM friends WHERE user='$view'");
|
$result = queryMysql("SELECT * FROM friends WHERE user='$view'");
|
||||||
|
|
||||||
|
$j = 0;
|
||||||
|
|
||||||
while ($row = $result->fetch())
|
while ($row = $result->fetch())
|
||||||
{
|
{
|
||||||
$followers[$j] = $row['friend'];
|
$followers[$j+] = $row['friend'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = queryMysql("SELECT * FROM friends WHERE friend='$view'");
|
$result = queryMysql("SELECT * FROM friends WHERE friend='$view'");
|
||||||
|
|
||||||
|
$j = 0;
|
||||||
|
|
||||||
while ($row = $result->fetch())
|
while ($row = $result->fetch())
|
||||||
{
|
{
|
||||||
$following[$j] = $row['user'];
|
$following[$j++] = $row['user'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$mutual = array_intersect($followers, $following);
|
$mutual = array_intersect($followers, $following);
|
||||||
|
|||||||
@@ -46,16 +46,21 @@
|
|||||||
function sanitizeString($var)
|
function sanitizeString($var)
|
||||||
{
|
{
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
$var = strip_tags($var);
|
$var = strip_tags($var);
|
||||||
$var = htmlentities($var);
|
$var = htmlentities($var);
|
||||||
|
|
||||||
if (get_magic_quotes_gpc())
|
if (get_magic_quotes_gpc())
|
||||||
$var = stripslashes($var);
|
$var = stripslashes($var);
|
||||||
|
|
||||||
$result = $pdo->quote($var); // This adds single quotes
|
$result = $pdo->quote($var); // This adds single quotes
|
||||||
return str_replace("'", "", $result); // So now remove them
|
return str_replace("'", "", $result); // So now remove them
|
||||||
}
|
}
|
||||||
|
|
||||||
function showProfile($user)
|
function showProfile($user)
|
||||||
{
|
{
|
||||||
|
global $pdo;
|
||||||
|
|
||||||
if (file_exists("$user.jpg"))
|
if (file_exists("$user.jpg"))
|
||||||
echo "<img src='$user.jpg' style='float:left;'>";
|
echo "<img src='$user.jpg' style='float:left;'>";
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ _END;
|
|||||||
|
|
||||||
$query = "SELECT * FROM messages WHERE recip='$view' ORDER BY time DESC";
|
$query = "SELECT * FROM messages WHERE recip='$view' ORDER BY time DESC";
|
||||||
$result = queryMysql($query);
|
$result = queryMysql($query);
|
||||||
|
$num = $result->rowCount();
|
||||||
|
|
||||||
while ($row = $result->fetch())
|
while ($row = $result->fetch())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user