Re: [pmwiki-devel] strange conversions: a FmtPageName bug

2008-05-08 Thread Hans
Thursday, May 8, 2008, 8:38:56 AM, Peter wrote: Any thoughts on this? Does it fill a need or do most recipe authors prefer to just handle their own substitutions on user-supplied data? I think it may be good to have a safe function. How about a convenience function like this: function

Re: [pmwiki-devel] strange conversions: a FmtPageName bug

2008-05-06 Thread Peter Melodye Bowers
Sunday, March 9, 2008, 2:33:29 AM, Patrick wrote: Also, as a general rule it's unwise to be calling FmtPageName() on strings that are coming from page markup, as this exposes the ability for people to view the values of variables that perhaps they shouldn't see. This is also why page

Re: [pmwiki-devel] strange conversions: a FmtPageName bug

2008-03-09 Thread Hans
Sunday, March 9, 2008, 2:33:29 AM, Patrick wrote: Also, as a general rule it's unwise to be calling FmtPageName() on strings that are coming from page markup, as this exposes the ability for people to view the values of variables that perhaps they shouldn't see. This is also why page

Re: [pmwiki-devel] strange conversions: a FmtPageName bug

2008-03-09 Thread Hans
Sunday, March 9, 2008, 11:55:17 AM, Hans wrote: the '$'t gets replaced with 'read' should read: the '$t' gets replace with 'read' Hans ___ pmwiki-devel mailing list pmwiki-devel@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Re: [pmwiki-devel] strange conversions: a FmtPageName bug

2008-03-09 Thread Hans
Sunday, March 9, 2008, 2:31:43 AM, Patrick wrote: Yes, the fact that globals leak into FmtPageName is a bit of a pain, but I'd rather find ways to avoid the leaks than to significantly slow down one of the most fundamental (and often called) parts of the code. How about 'defusing' potential

Re: [pmwiki-devel] strange conversions: a FmtPageName bug

2008-03-09 Thread Patrick R. Michaud
On Sun, Mar 09, 2008 at 11:55:17AM +, Hans wrote: Sunday, March 9, 2008, 2:33:29 AM, Patrick wrote: Also, as a general rule it's unwise to be calling FmtPageName() on strings that are coming from page markup, as this exposes the ability for people to view the values of variables that

Re: [pmwiki-devel] strange conversions: a FmtPageName bug

2008-03-09 Thread Patrick R. Michaud
On Sun, Mar 09, 2008 at 12:32:58PM +, Hans wrote: Out of curiosity: what makes '$t' into a global? It is hard to search the code for this. Any variabes that aren't part of a function are global. This would include variables that are used in the course of initializing PmWiki or any

Re: [pmwiki-devel] strange conversions: a FmtPageName bug

2008-03-09 Thread Hans
Sunday, March 9, 2008, 2:36:58 PM, Patrick wrote: The way to prevent these from becoming global would be to put all of initialization steps into separate functions (thus making these variables local). While we could do this for PmWiki, we'd still have global variables leaking out via

Re: [pmwiki-devel] strange conversions: a FmtPageName bug

2008-03-08 Thread Hans
Saturday, March 8, 2008, 11:58:35 PM, Hans wrote: A less aggressive and more precise replacement can be done instead with: foreach($g as $k=$v) $fmt = preg_replace(/$k/,$v $fmt); that does not do it. Perhaps this, which asks for a word boundary: foreach($g as $k = $v)

Re: [pmwiki-devel] strange conversions: a FmtPageName bug

2008-03-08 Thread Patrick R. Michaud
On Sun, Mar 09, 2008 at 12:36:09AM +, Hans wrote: Saturday, March 8, 2008, 11:58:35 PM, Hans wrote: A less aggressive and more precise replacement can be done instead with: foreach($g as $k=$v) $fmt = preg_replace(/$k/,$v $fmt); that does not do it. Perhaps this,

Re: [pmwiki-devel] strange conversions: a FmtPageName bug

2008-03-08 Thread Patrick R. Michaud
On Sat, Mar 08, 2008 at 08:31:43PM -0600, Patrick R. Michaud wrote: On Sun, Mar 09, 2008 at 12:36:09AM +, Hans wrote: Saturday, March 8, 2008, 11:58:35 PM, Hans wrote: A less aggressive and more precise replacement can be done instead with: foreach($g as $k=$v)