plp050452 / simplesamlphp

Automatically exported from code.google.com/p/simplesamlphp
Other
0 stars 0 forks source link

Memcache object is used before test whether it exists #544

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
SSP's Memcache class uses the PHP memcache extension. In 
loadMemcacheServerGroup() a new Memcache object is created. Right after that an 
exception is thrown is this failed with the suggestion to install the PHP 
module. However, if you do not have the PHP module, PHP will exit already with 
a fatal error at the object creation so this exception is never raised. 
Attached patch moves the object creation into the if statement to raise the 
exception when the PHP module is not installed.

Original issue reported on code.google.com by thijs@kinkhorst.com on 28 Mar 2013 at 9:29

Attachments:

GoogleCodeExporter commented 8 years ago
I do not believe the NULL comparison is necessary. I therefore replaced the 
test with a check using only class_exists(), and moved it to the front of the 
object creation. (Committed in r3230).

Thanks for reporting this bug!

Original comment by olavmrk@gmail.com on 3 Apr 2013 at 6:28