Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4888: Undefined Index warnings during IMS CC import #8

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

iam-TJ
Copy link

@iam-TJ iam-TJ commented Oct 25, 2011

@@ -26,19 +26,19 @@ if ($_GET['tile']) {
<html lang="<?php echo $myLang->getCode(); ?>">
<head>
<title><?php echo _AT($lang_variable); ?></title>
<?php if ($_GET['frame']) { ?>
<?php if (array_key_exists('frame', $_GET)) { ?>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 18 uses "isset($_GET['tile']) && $_GET['tile']" to check the presence of the $_GET value while this line uses another approach. Should we make it consistent by using one way through? The same comment applies to line 36, 41.

BTW, I personally likes the line 18 way better. :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference is that isset() will return false for array keys that have their value set to NULL whereas array_key_exists() only checks that the key exists.

That said, I'm struggling to recall the reason I used these styles of code. I think it was because I believed or saw that some of the GET variables may be NULL e.g. "/home/prog.php" rather than "/home/prog.php?done"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants