| Author |
Message |
Darrell3831 Worker


Joined: Feb 18, 2004 Posts: 244
|
Posted:
Tue Jan 31, 2006 5:08 am |
|
Within the code of a module it's necessary to know what patched version you have so that you can make conditional tests.
For instance:
| Code: | define('INDEX_FILE', true); // 3.1 or later - show right hand blocks
$index = 0; // 3.0 or earlier - show right hand blocks |
Is there a test I can run in php that will tell me what patched version my code is running under?
Thanks,
Darrell |
|
|
|
 |
montego Site Admin

Joined: Aug 29, 2004 Posts: 7216 Location: Arizona
|
Posted:
Tue Jan 31, 2006 6:38 am |
|
Darrell3831, unfortunately not. What I have done recently is within my index file I simple define both. In my opinion, it really isn't introducing any security risk because if you are 3.0 and under, it requires $index be set anyways, and if you are running 3.1, nothing looks at $index variable anyways. |
|
|
|
 |
Darrell3831 Worker


Joined: Feb 18, 2004 Posts: 244
|
Posted:
Tue Jan 31, 2006 9:14 am |
|
huh,
Well that's a simple solution I had'nt thought of.
Thanks again Montego! |
|
|
|
 |
evaders99 Moderator

Joined: Apr 30, 2004 Posts: 2744
|
Posted:
Tue Jan 31, 2006 11:18 am |
|
Simple enough - mainfile.php has the 3.1 version number on it.
If it doesn't, then you know its 3.0 or earlier |
|
|
|
 |
Darrell3831 Worker


Joined: Feb 18, 2004 Posts: 244
|
Posted:
Tue Jan 31, 2006 11:29 am |
|
Sorry Evaders,
I don't think I understand what your saying... Could you fix this thing you called a simple test for me, please?
| Code: | if (mainfile.php => 3.1) { // Simple test
define('INDEX_FILE', true);
}
else {
$index = 0;
} |
Thanks,
Darrell |
|
|
|
 |
evaders99 Moderator

Joined: Apr 30, 2004 Posts: 2744
|
Posted:
Tue Jan 31, 2006 11:32 am |
|
Ah - you wanted a code way to determine their patched level. Sorry.
montego is correct. You can define both, it won't hurt you |
|
|
|
 |
Darrell3831 Worker


Joined: Feb 18, 2004 Posts: 244
|
Posted:
Tue Jan 31, 2006 11:35 am |
|
|
|
 |
|
|
|
|