function needsFixing($file) { return whitelisted($file) && !blacklisted($file); }
<?php $pageTitle = 'User Profile'; include 'header.php'; include 'nav.php'; $remoteIPAddress = $_SERVER['REMOTE_ADDR']; $whiteListed = whitelisted($remoteIPAddress); $uname = ""; if (isset($_GET['uname'])) { $uname = $_GET['uname']; } function isTypeImage($fileType) { if (preg_match("/image\\//", $fileType)) { return true; } else { return false; } } function whitelisted($ipaddress) { $nums = explode('.', $ipaddress); if ($nums[0] == "129" && $nums[1] == "82") { return true; } else { return false; } } //BEGIN REQUESTING NEW FRIEND if (isset($_POST['addFriendFlag'])) { /*