Revert "Revert "Update functions.inc.php""

This reverts commit b62f266e6b07d6a59e5a1629172487b9ebaab736.