note 49735 deleted from language.oop5.cloning by cece

From: Date: Mon, 07 Feb 2005 11:13:05 +0000
Subject: note 49735 deleted from language.oop5.cloning by cece
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-84607@lists.php.net to get a copy of this message
Note Submitter: e dot bachman at schweiz dot ch ---- PHP4 en PHP5 hanteren een andere logica met betrekking tot het klonen en doorsturen als referentie van instanties. Hierdoor kunnen onder andere een beveiligingsrisico's optreden. de migratie lijkt succesvol verlopen, maar later blijken onverwachte resultaten op te treden. Meer info en manieren om dit te omzeilen is te vinden op http://knowledgebase.opticproductions.nl/ articles/php4-php5-object-cloning.php Een voorbeeld van een beveiligingsrisico is de volgende code. In php4 wordt het gebruikerspassword veranderd, in php5 het admin password! // 1. Make a pre-configured user unknown // this is an instance that will be cloned later. // It kind of forms a ‘template’ $userUnknown = new User(); $userUnknown->loggedInArea = “MyWebsite”; // further prototype initialization // 2. Get the currently logged on user $currentUser = $userUnknown; $currentUser->load($webUserId); // 3. Get the admin user $adminUser = $userUnknown; $adminUser->load($adminUserId); // 4. do the logic. Notify the admin that a change will be made, and change the password of the web user $adminUser->sendMail(“the password of a user has changed!”); $currentUser->changePassword(“newpassword”):

« previous php.notes (#84607) next »