Tag Archives: error

WordPress 3.3.1 update.

Yesterday an security update for wordpress has been released. It fixes 15 minor issues and one XSS vulnerability. It is strongly advised to update your wordpress if you have installed your blog using an IP address (http://x.x.x.x/wp-admin/) instead of domain name (http://example.com/wp-admin).
This flaw can render your blog an “infected” nasty place which could serve your users unwanted content.
In my case it was a real issue so this blog is already patched up, I advise you to do the same!

T_PAAMAYIM_NEKUDOTAYIM error in PHP

Today I’ve encountered a very strange error which was quite similar to Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in….
At the first look I thought it’s a joke from the second programmer I’ve been working with but I was wrong.

This error is addressing to Scope Resolution Operator (::).
The problem is that this error can happen in quite unpredictable places – like in my example:

define('IPHONE',true);
 
[...]
 
if(defined(IPHONE)){
	$mediumlimit = " AND (Media=0 OR Media=2)";
} else {
	$mediumlimit = " AND (Media=0 OR Media=1)";
}

Line if(defined(IPHONE)){ was throwing an error.
When I’ve added quotes around IPHONE constant name the error was gone!

Sometimes error messages can cause headache when they are weird and completely not related to actual code – god bless google for letting me fix it in no time!