From 3ef85fff05cef01894ef054f79aa35c9a6f6af1b Mon Sep 17 00:00:00 2001 From: Nick Barry <nbarry10@unl.edu> Date: Tue, 9 Jun 2015 18:11:14 -0500 Subject: [PATCH] Updated methods to correctly check to see if a file exists on admin actions --- .../modules/bulletin/controllers/AdminController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/modules/bulletin/controllers/AdminController.php b/application/modules/bulletin/controllers/AdminController.php index 29e5dc9f..4adfb294 100644 --- a/application/modules/bulletin/controllers/AdminController.php +++ b/application/modules/bulletin/controllers/AdminController.php @@ -79,7 +79,7 @@ class Bulletin_AdminController extends Creq_Controller_Action // get file path and name for major $filePath = 'data' .DIRECTORY_SEPARATOR. Bulletin_RepositoryModel::getInstance()->getFilePathForCollegeMajorYear($in['college'], $major, $currentYear); - if (!$filePath) { + if (!is_file($filePath)) { $this->_helper->getHelper('FlashMessenger')->addMessage('Unable to find an existing file for that college/major.'); $this->redirect('/bulletin/admin/change-major-name'); } @@ -147,7 +147,7 @@ class Bulletin_AdminController extends Creq_Controller_Action // get file path and name for major $filePath = 'data' .DIRECTORY_SEPARATOR. Bulletin_RepositoryModel::getInstance()->getFilePathForCollegeMajorYear($in['college'], $major, $currentYear); - if (!$filePath) { + if (!is_file($filePath)) { $this->_helper->getHelper('FlashMessenger')->addMessage('Unable to find an existing file for that college/major.'); $this->redirect('/bulletin/admin/change-major-name'); } @@ -468,7 +468,7 @@ class Bulletin_AdminController extends Creq_Controller_Action // get file path and name for major $filePath = 'data' .DIRECTORY_SEPARATOR. Bulletin_RepositoryModel::getInstance()->getFilePathForCollegeMajorYear($in['college'], $major, $currentYear); - if (!$filePath) { + if (!is_file($filePath)) { $this->_helper->getHelper('FlashMessenger')->addMessage('Unable to find an existing file for that college/major.'); $this->redirect('/bulletin/admin/remove-major'); } -- GitLab