Attached Files | 0001-BUG-Properly-check-if-specified-project-exists.patch [^] (2,108 bytes) 2014-01-02 14:28 [Show Content] [Hide Content]From cb33edb1f712a55e2fc0abc3a95c88a4d276fd70 Mon Sep 17 00:00:00 2001
From: Igor Murzov <e-mail@date.by>
Date: Sun, 1 Dec 2013 21:13:28 +0400
Subject: [PATCH] BUG: Properly check if specified project exists
---
api/api_build.php | 6 +++---
api/api_coverage.php | 2 +-
api/api_user.php | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/api/api_build.php b/api/api_build.php
index 929e1a3..74b9967 100644
--- a/api/api_build.php
+++ b/api/api_build.php
@@ -40,7 +40,7 @@ class BuildAPI extends CDashAPI
}
$projectid = get_project_id($this->Parameters['project']);
- if(!is_numeric($projectid))
+ if(!is_numeric($projectid) || $projectid <= 0)
{
echo "Project not found";
return;
@@ -118,7 +118,7 @@ class BuildAPI extends CDashAPI
}
$projectid = get_project_id($this->Parameters['project']);
- if(!is_numeric($projectid))
+ if(!is_numeric($projectid) || $projectid <= 0)
{
echo "Project not found";
return;
@@ -179,7 +179,7 @@ class BuildAPI extends CDashAPI
}
$projectid = get_project_id($this->Parameters['project']);
- if(!is_numeric($projectid))
+ if(!is_numeric($projectid) || $projectid <= 0)
{
echo "Project not found";
return;
diff --git a/api/api_coverage.php b/api/api_coverage.php
index c430247..dfd0aa5 100644
--- a/api/api_coverage.php
+++ b/api/api_coverage.php
@@ -38,7 +38,7 @@ class CoverageAPI extends CDashAPI
}
$projectid = get_project_id($this->Parameters['project']);
- if(!is_numeric($projectid))
+ if(!is_numeric($projectid) || $projectid <= 0)
{
echo "Project not found";
return;
diff --git a/api/api_user.php b/api/api_user.php
index a994bfe..6429669 100644
--- a/api/api_user.php
+++ b/api/api_user.php
@@ -37,7 +37,7 @@ class UserAPI extends CDashAPI
}
$projectid = get_project_id($this->Parameters['project']);
- if(!is_numeric($projectid))
+ if(!is_numeric($projectid) || $projectid <= 0)
{
echo "Project not found";
return;
--
1.8.4
|