Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6 Bugs/Fixes
Author Message
SuperCat
Hangin' Around



Joined: Nov 27, 2004
Posts: 37
Location: MN

PostPosted: Mon Dec 13, 2004 9:13 am Reply with quote

In my experience from making a lot of blocks and moules for users, i have come to find that a certain percentage of users have problems when an array is accessed when it is not formatted correctly. This also applies to server variables like $_SERVER[HTTP_USER_AGENT].

An array is basically many variables in one. Instead of having this:
Code:
$var1 $var2 $var3 etc...


We can have everything inside $var like:
Code:
 $var[1] $var[2] $var[3] etc...


Anyways, when accessing these vars, theres a correct way to do them and a wrong way in certain circumstances. Basically 3 possible ways. 2 are correct, 1 is wrong.

Examples of this:

Inside double quotes (correct):
Code:
echo "$var[1]";


Outside double quotes (correct) (notice the single quotes):
Code:
if ($var['1'] == 10) { echo "$var[1]"; }


Outside double quotes (wrong) (missing single quotes on var outside double quotes):
Code:
if ($var[1] == 10) { echo "$var[1]"; }


The wrong style may work on most users, but it doesnt work on ALL users.

PHP-Nuke is littered with bad arrays.

This is probably the cause of the login security code problem for nuke 7.5 and 7.6 discussed in another thread.

_________________
How deep can we dig the rabbit hole? 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6 Bugs/Fixes

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©