Skip to content

Commit

Permalink
Added fix for SQL Injection
Browse files Browse the repository at this point in the history
  • Loading branch information
nym3r0s committed Jan 22, 2015
1 parent cdff158 commit 28f8b05
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 22 deletions.
4 changes: 2 additions & 2 deletions matchday/confirm11.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
session_start();
require './../includes/dbconfig.php';
$user = $_SESSION['user'];
$user = mysql_real_escape_string($_SESSION['user'])s;
if(!isset($user))
{
header('Location: ./../login.php');
}

$idString = $_POST['c11'];
$idString = mysql_real_escape_string($_POST['c11']);
echo($idString."\n");
$ids = explode(',',$idString);
sort($ids);
Expand Down
3 changes: 3 additions & 0 deletions matchday/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
header('Location: ./matchday.php');
?>
2 changes: 1 addition & 1 deletion matchday/matchday.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
session_start();
require './../includes/dbconfig.php';
$user = $_SESSION['user'];
$user = mysql_real_escape_string($_SESSION['user']);
if(!isset($user))
{
header('Location: ./../login.php');
Expand Down
6 changes: 3 additions & 3 deletions matchday/playerInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

//echo("done");

$playerId = $_POST['req'];
$user = $_SESSION['user'];
$playerId = mysql_real_escape_string($_POST['req']);
$user = mysql_real_escape_string($_SESSION['user']);

if(!isset($user))
{
Expand Down Expand Up @@ -72,7 +72,7 @@

echo('<div class="row_left"> <div><b>Country</b></div> <div><b>Player Role</b></div> <div><b>Matches</b></div> <div><b>Form</b></div> <div><b>Confidence</b></div> </div>');

echo('<div class="row_right"> <div>'.$playerCountry.'</div> <div>'.$playerType.'</div> <div>'.$playerMatches.'</div> <div>'.$playerForm.'</div><div>'.$playerConfidence.'</div></div>');
echo('<div class="row_right"> <div>'.$playerCountry.'</div> <div>'.$playerType.'</div> <div>'.$playerMatches.'</div> <div>'.$playerForm.'</div><div>'.$playerConfidence.'</div></div>');

if($playerCaptain != ""){ echo('<div class="row"><b>Captain</b></div><br>'); }
echo('</div>');
Expand Down
2 changes: 1 addition & 1 deletion matchday/squadGen.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
session_start();
require './../includes/dbconfig.php';

$user = $_SESSION['user'];
$user = mysql_real_escape_string($_SESSION['user']);


if(!isset($user))
Expand Down
2 changes: 1 addition & 1 deletion transfers/balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
session_start();
require './../includes/dbconfig.php';

$user = $_SESSION['user'];
$user = mysql_real_escape_string($_SESSION['user']);


if(!isset($user))
Expand Down
4 changes: 2 additions & 2 deletions transfers/confirm16.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
session_start();
require './../includes/dbconfig.php';
$user = $_SESSION['user'];
$user = mysql_real_escape_string($_SESSION['user']);
if(!isset($user))
{
header('Location: ./../login.php');
}

$idString = $_POST['c16'];
$idString = mysql_real_escape_string($_POST['c16']);
$ids = explode(',',$idString);
sort($ids);

Expand Down
3 changes: 3 additions & 0 deletions transfers/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
header('Location: ./transfers.php');
?>
6 changes: 3 additions & 3 deletions transfers/playerInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

//echo("done");

$playerId = $_POST['req'];
$user = $_SESSION['user'];
$playerId = mysql_real_escape_string($_POST['req']);
$user = mysql_real_escape_string($_SESSION['user']);

if(!isset($user))
{
Expand Down Expand Up @@ -72,7 +72,7 @@

echo('<div class="row_left"> <div><b>Country</b></div> <div><b>Player Role</b></div> <div><b>Matches</b></div> <div><b>Form</b></div> <div><b>Confidence</b></div> </div>');

echo('<div class="row_right"> <div>'.$playerCountry.'</div> <div>'.$playerType.'</div> <div>'.$playerMatches.'</div> <div>'.$playerForm.'</div><div>'.$playerConfidence.'</div></div>');
echo('<div class="row_right"> <div>'.$playerCountry.'</div> <div>'.$playerType.'</div> <div>'.$playerMatches.'</div> <div>'.$playerForm.'</div><div>'.$playerConfidence.'</div></div>');

if($playerCaptain != ""){ echo('<div class="row"><b>Captain</b></div><br>'); }
echo('</div>');
Expand Down
2 changes: 1 addition & 1 deletion transfers/playersGen.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
session_start();
require './../includes/dbconfig.php';

$user = $_SESSION['user'];
$user = mysql_real_escape_string($_SESSION['user']);


if(!isset($user))
Expand Down
2 changes: 1 addition & 1 deletion transfers/remainingTransfers.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
session_start();
require './../includes/dbconfig.php';
$user = $_SESSION['user'];
$user = mysql_real_escape_string($_SESSION['user']);
if(!isset($user))
{
header('Location: ./../login.php');
Expand Down
12 changes: 6 additions & 6 deletions transfers/transfers.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
session_start();
require './../includes/dbconfig.php';
$user = $_SESSION['user'];
$user = mysql_real_escape_string($_SESSION['user']);
if(!isset($user))
{
header('Location: ./../login.php');
Expand Down Expand Up @@ -50,11 +50,11 @@
</nav>

<!-- Nav Ends here-->
<div class="transferDetails">
<div id="playerBalance"></div>
<div id="transferBalance"></div>
</div>
<div class="transferDetails">
<div id="playerBalance"></div>
<div id="transferBalance"></div>
</div>

<div id="switches">
<div class="btn-group" role="group" aria-label="...">
<div class="btn-group" role="group">
Expand Down
2 changes: 1 addition & 1 deletion transfers/userGen.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
session_start();
require './../includes/dbconfig.php';

$user = $_SESSION['user'];
$user = mysql_real_escape_string($_SESSION['user']);


if(!isset($user))
Expand Down

0 comments on commit 28f8b05

Please sign in to comment.