Double check int and null, safety first! (php)

2016/08/23 23:52:35
Author Profile Picture

posted by

@florianpreusner

Double check ftw! Check if it's a integer AND if it's not null. Yip!


if(is_int(intval($category)) && null !== $category) {
    $topicFacade=newPage_Helper_Facade();
    $topic=$topicFacade->getTopicById($category);
    $topicUrl=$topic->getUrl();
}
Share on Google+