phpvms / phpvms_v2

Virtual Airline Management (not maintained)
http://www.phpvms.net
BSD 3-Clause "New" or "Revised" License
41 stars 46 forks source link

Found one major bug with templates. ;) #99

Closed Vansers closed 11 years ago

Vansers commented 11 years ago

Nabeel

In all of the template files, you use the define IN_PHPVMS...but look at the code...

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>

You shouldn't really be using the && function because say if you use the first operation, but the second one fails, that's still going to allow users to get the template.

My suggestion, would this improve it's security by using this OR operator?

<?php if(!defined('IN_PHPVMS') || IN_PHPVMS !== true) { die(); } ?>

nabeelio commented 11 years ago

Hey,

That's not a bug. It reads that "if IN_PHPVMS doesn't exist, and it's not == to true, then quit". In reality, it can just be simplified to "if(!defined('IN_PHPVMS')) { die(); }"