Re: cvs: php4 /pear/HTML Menu.php

From: Date: Wed, 12 Sep 2001 21:53:46 +0000
Subject: Re: cvs: php4 /pear/HTML Menu.php
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-1893@lists.php.net to get a copy of this message
As I can now see, a patch wasn't necessary. There's was a need for this patch for me, so that I could easily set the current url to whatever value I needed in my script. Without the patch I could have also make it work, but I would have to set $this->url_env_var to whatever global variable I have saved the url in. (I only concluded this after reading your mail.) I guess that if you change it to: if (!isset($GLOBALS[$this->url_env_var]) { return $this->url_env_var; } return $GLOBALS[$this->url_env_var]; It would become a little 'too flexible'. (e.g. what if your current url is PHPSELF (very unlikely, but why make it complicated?) So: Sorry, I was wrong and my patch has to be reverted. Kind regards, Ronald van den Berg Internet Application Developer Auxilium SD -Original Message------------------------------- On Wednesday 12 September 2001 17:55, Martin Jansen wrote: > mj Wed Sep 12 11:55:41 2001 EDT > > Modified files: > /php4/pear/HTML Menu.php > Log: > * Patch by Ronald van den Berg <vandenberg@auxilium-sd.nl> > > > function getCurrentURL() { > - return $GLOBALS[$this->url_env_var]; > + return $this->url_env_var; > } This patch will break the functionality of the class. The url_env_var is used to find where you are. By default is 'PHP_SELF', so it uses: $GLOBALS['PHPSELF'], or you could use REQUEST_URI for example. But whithout the $GLOBALS, by default the function will return the string 'PHP_SELF' breaking the detection mechanism. At least the patch could be (not tested), something like: if (!isset($GLOBALS[$this->url_env_var]) { return $this->url_env_var; } return $GLOBALS[$this->url_env_var]; If not, IMHO should be reverted. Tomas V.V.Cox -- PEAR CVS Mailing List (http://pear.php.net/) To unsubscribe, e-mail: pear-cvs-unsubscribe@lists.php.net For additional commands, e-mail: pear-cvs-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.pear.dev (#1893) next »