diff --git a/application/modules/bulletin/controllers/NewController.php b/application/modules/bulletin/controllers/NewController.php index 14acc6f7dc7ea9857f00e74ade169f993856caa6..e1540a99f8013dad37b874385d44cff8a008fb5b 100644 --- a/application/modules/bulletin/controllers/NewController.php +++ b/application/modules/bulletin/controllers/NewController.php @@ -46,7 +46,7 @@ class Bulletin_NewController extends Creq_Controller_Action $pullRequestNumber = $request->getPullRequestNumber(); // Make sure we have a number and not NULL - if ($pullRequestNumber != 'NULL' && $pullRequestNumber != ''){ + if (is_int($pullRequestNumber) && intval($pullRequestNumber) > 0){ $merged = Bulletin_RepositoryModel::getInstance()->pullRequestHasBeenMerged(intval($pullRequestNumber)); if ($merged == false) { diff --git a/application/modules/bulletin/models/ApprovalActionPullRequestModel.php b/application/modules/bulletin/models/ApprovalActionPullRequestModel.php index 4cb9d1604b8a1bba1f67ccdd8f72004afd58da64..6357f0a4f0adf2f652f76d6fcd0b495acf46e607 100644 --- a/application/modules/bulletin/models/ApprovalActionPullRequestModel.php +++ b/application/modules/bulletin/models/ApprovalActionPullRequestModel.php @@ -137,13 +137,15 @@ class Bulletin_ApprovalActionPullRequestModel extends Requests_ApprovalActionMod $safeRequestId = intval($requestId); $safePullRequestNumber = intval($pullRequestNumber); - $data = array( - 'pullRequestNumber' => $safePullRequestNumber - ); - $where = "requestId = '$safeRequestId'"; + if ($safePullRequestNumber > 0) { + $data = array( + 'pullRequestNumber' => $safePullRequestNumber + ); + $where = "requestId = '$safeRequestId'"; - $db = Zend_Registry::get('db'); - $db->update('creqRequests', $data, $where); + $db = Zend_Registry::get('db'); + $db->update('creqRequests', $data, $where); + } } }