diff --git a/config.php b/config.php
index 19124ee..a053e5f 100644
--- a/config.php
+++ b/config.php
@@ -14,6 +14,7 @@
*/
//error_reporting(E_ALL); ini_set('display_errors','On');
date_default_timezone_set('Europe/London');
+$conf = new stdClass();
$conf->db = 'NewJiraDB';
$conf->host = 'flibble.home';
$conf->user = 'jira';
@@ -28,7 +29,10 @@ $conf->customUsernames = true; // Set this to true if you want to honour anythin
// Limit requests for a given IP to a specific set of project keys, prefix the IP with a lowercase a
$conf->IPProjectRestrictions = array('a46.32.254.153'=>
- 'VFJ,MCI,MAILARCHIV,PHPCRED,NLA,GPXIN,VCL,VEHPI,JILS,BTFW,PIDVR,PLGSCH,PHPCBA,URLBRND,VEH,BUGGER,JWL,MGF,BHAYSTACKG,DNSCHAT,MISC,HLS,HLSDVD,PAS,XMLRPCPLG,LOC,ADBLK,FKAMP,VID'
+ 'VFJ,MCI,MAILARCHIV,PHPCRED,NLA,GPXIN,VCL,VEHPI,JILS,BTFW,PIDVR,PLGSCH,PHPCBA,URLBRND,VEH,BUGGER,JWL,MGF,BHAYSTACKG,DNSCHAT,MISC,HLS,HLSDVD,PAS,XMLRPCPLG,LOC,ADBLK,FKAMP,VID',
+'a192.168.1.70'=>
+ 'VFJ,MCI,MAILARCHIV,PHPCRED,NLA,GPXIN,VCL,VEHPI,JILS,BTFW,PIDVR,PLGSCH,PHPCBA,URLBRND,VEH,BUGGER,JWL,MGF,BHAYSTACKG,DNSCHAT,MISC,HLS,HLSDVD,PAS,XMLRPCPLG,LOC,ADBLK,FKAMP,VID'
+
); // Example: array('a192.168.1.2'=> 'FOO,BAR,CHAR');
diff --git a/queries/issue_page.php b/queries/issue_page.php
index 7a57263..ff09485 100644
--- a/queries/issue_page.php
+++ b/queries/issue_page.php
@@ -160,7 +160,7 @@ $sql = "SELECT * FROM remotelink WHERE ISSUEID=".(int)$issue->ID;
$db->setQuery($sql);
$relationsext = $db->loadResults();
-if (count($relationsext) < 1){ // Make sure we don't generate a NOTICE later
+if (count(get_object_vars($relationsext)) < 1){ // Make sure we don't generate a NOTICE later
$relationsext = array();
}
@@ -309,7 +309,7 @@ $TIMESPENT = $issue->TIMESPENT;
$TIMEESTIMATE = $issue->TIMEESTIMATE;
$TIMEORIGINALESTIMATE = $issue->TIMEORIGINALESTIMATE;
-if (count($subtasks) > 0){
+if (count(get_object_vars($subtasks)) > 0){
// Get Subtasks
$sql = "select SUM(c.TIMESPENT) as timespent, SUM(c.TIMEESTIMATE) as timeestimate, SUM(c.TIMEORIGINALESTIMATE) as timeoriginalestimate ".
diff --git a/templates/html/issue_page.php b/templates/html/issue_page.php
index cd23631..07054e4 100644
--- a/templates/html/issue_page.php
+++ b/templates/html/issue_page.php
@@ -26,7 +26,7 @@ defined('listpage') or die;
SUMMARY);
- if (count($labels) > 0 ){
+ if (count(get_object_vars($labels)) > 0 ){
foreach ($labels as $label){
$keywords[] = $label->LABEL;
}
@@ -136,7 +136,7 @@ defined('listpage') or die;
- 0): ?>
+ 0): ?>
Target version:
ID}&proj={$issue->pkey}"); ?>">vname);?>,
@@ -157,7 +157,7 @@ defined('listpage') or die;
- 0 ):?>
+ 0 ):?>
Labels: LABEL}, "; }?>
@@ -225,7 +225,7 @@ defined('listpage') or die;
- 0):?>
+ 0):?>
Attachments
@@ -257,7 +257,7 @@ defined('listpage') or die;
- 0 || count($relationsext) > 0):
+ 0 || count(get_object_vars($relationsext)) > 0):
?>
@@ -299,7 +299,7 @@ defined('listpage') or die;
- 0): ?>
+ 0): ?>
Subtasks
@@ -372,7 +372,7 @@ defined('listpage') or die;
- 0): ?>
+ 0): ?>
Work log
diff --git a/templates/html/version-issues.php b/templates/html/version-issues.php
index b84e31d..6f99a84 100644
--- a/templates/html/version-issues.php
+++ b/templates/html/version-issues.php
@@ -70,7 +70,7 @@ defined('listpage') or die;
Issues
- 0):?>
+ 0):?>
Known Issues
ENVIRONMENT; ?>
- 0): ?>
+ 0): ?>
Components:
- cname;?>
- 0):?>
+ 0):?>
Affected Versions:
- vname;?>
@@ -59,7 +59,7 @@ Affected Versions:
- 0): ?>
+ 0): ?>
Targeted for fix in version:
- vname;?>
@@ -67,7 +67,7 @@ Targeted for fix in version:
- 0 ):?>
+ 0 ):?>
Labels: LABEL}, "; }?>
@@ -84,7 +84,7 @@ Issue Description
DESCRIPTION); ?>
- 0):?>
+ 0):?>
-----------------------------------------------------------------------------------------
Attachments
@@ -97,7 +97,7 @@ Attachments
- 0 || count($relationsext) > 0): ?>
+ 0 || count(get_object_vars($relationsext)) > 0): ?>
-----------------------------------------------------------------------------------------
Issue Relations
@@ -118,7 +118,7 @@ Issue Relations
- 0): ?>
+ 0): ?>
-----------------------------------------------------------------------------------------
Subtasks
@@ -152,7 +152,7 @@ Activity
- 0): ?>
+ 0): ?>
-----------------------------------------------------------------------------------------
Worklog
diff --git a/utils.class.php b/utils.class.php
index 5f509f2..69a8051 100644
--- a/utils.class.php
+++ b/utils.class.php
@@ -89,13 +89,13 @@ class BTDB{
if (!$this->linkident)
$this->opendb();
- $res = mysql_query($this->query);
+ $res = mysqli_query($this->linkident,$this->query);
// Output any errors if configured to do so
$this->checkErrors();
- $id = mysql_insert_id();
+ $id = mysqli_insert_id();
// if connection re-use has been disabled, close the link
if (!$this->connreuse){ $this->closedb(); }
@@ -113,7 +113,7 @@ class BTDB{
if (!$this->linkident)
$this->opendb();
- $res = mysql_query($this->query);
+ $res = mysqli_query($this->query);
// Output any errors if configured to do so
$this->checkErrors();
@@ -143,7 +143,7 @@ class BTDB{
if (strpos("LIMIT 1",$this->query) === false)
$additional = " LIMIT 1";
- $res = mysql_fetch_object(mysql_query($this->query . $additional));
+ $res = mysqli_fetch_object(mysqli_query($this->linkident,$this->query . $additional));
// Output any errors if configured to do so
$this->checkErrors();
@@ -165,14 +165,14 @@ class BTDB{
$this->opendb();
- $result = mysql_query($this->query);
+ $result = mysqli_query($this->linkident,$this->query);
$this->checkErrors();
$X=0;
-
- while ($row = mysql_fetch_object($result)){
+ $results = new stdClass();
+ while ($row = mysqli_fetch_object($result)){
$rowname = "row$X";
$results->$rowname = $row;
$X++;
@@ -197,7 +197,7 @@ class BTDB{
$this->opendb();
- $string = mysql_real_escape_string($string);
+ $string = mysqli_real_escape_string($this->linkident,$string);
if (!$this->connreuse)
$this->closedb();
@@ -249,7 +249,7 @@ class BTDB{
*/
function checkErrors(){
// Output errors if configured to do so
- $error = mysql_error();
+ $error = mysqli_error($this->linkident);
if ($this->showDBErrors){ echo $error; }
if (!empty($error)){
@@ -270,17 +270,17 @@ class BTDB{
// Open the Database connection
- $this->linkident = mysql_connect($this->dbserver, $this->dbuser, $this->dbpass);
+ $this->linkident = mysqli_connect($this->dbserver, $this->dbuser, $this->dbpass);
if (!$this->linkident) {
- die('Could not connect: ' . mysql_error());
+ die('Could not connect: ' . mysqli_error());
}else{
// Connect to the database if one is named
if (!empty($this->dbname)){
- $db_selected = mysql_select_db($this->dbname, $this->linkident);
+ $db_selected = mysqli_select_db($this->linkident,$this->dbname);
if (!$db_selected) {
- die ('Can\'t use ' . $this->dbname . ': ' . mysql_error());
+ die ('Can\'t use ' . $this->dbname . ': ' . mysqli_error());
}
}
@@ -299,7 +299,7 @@ class BTDB{
// Only close the link if it's active
if (!$this->linkident){ return; }
- mysql_close($this->linkident);
+ mysqli_close($this->linkident);
// Unset the link ID
$this->linkident=false;