From: Jonny B. <jo...@ti...> - 2011-11-13 15:44:17
|
Thanks Chealer - this cc'd to LP I did that change because some of the plugins (carousel i tihnk i was on) use 1/0 for booleans instead of y/n, and when the default it "1" you cannot turn it off as "0" equates to empty. I suppose something like: $value === "0" || !empty($value) would work... jb On 7 Nov 2011, at 20:21, Filipus Klutiero wrote: > Le 2011-10-14 14:41, jon...@us... a écrit : >> Revision: 38292 >> http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=38292&view=rev >> Author: jonnybradley >> Date: 2011-10-14 18:41:13 +0000 (Fri, 14 Oct 2011) >> Log Message: >> ----------- >> [FIX] plugin edit: Don't strip out empty params (this included values such as "0") >> >> Modified Paths: >> -------------- >> branches/8.x/tiki-wikiplugin_edit.php >> >> Modified: branches/8.x/tiki-wikiplugin_edit.php >> =================================================================== >> --- branches/8.x/tiki-wikiplugin_edit.php 2011-10-14 18:19:35 UTC (rev 38291) >> +++ branches/8.x/tiki-wikiplugin_edit.php 2011-10-14 18:41:13 UTC (rev 38292) >> @@ -57,8 +57,7 @@ >> >> $parts = array(); >> foreach ( $values as $key => $value ) { >> - if ( ! empty( $value ) ) >> - $parts[] = "$key=\"" . str_replace( '"', "\\\"", $value ) . '"'; >> + $parts[] = "$key=\"" . str_replace( '"', "\\\"", $value ) . '"'; >> } >> >> $params = implode( ' ', $parts ); >> > > This was effectively reverted in r38744. On 7 Nov 2011, at 19:41, lph...@us... wrote: > Revision: 38744 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=38744&view=rev > Author: lphuberdeau > Date: 2011-11-07 19:41:48 +0000 (Mon, 07 Nov 2011) > Log Message: > ----------- > [FIX] Plugin editor should not include empty values, many plugins break because they do not accept empty values > > Modified Paths: > -------------- > branches/8.x/tiki-wikiplugin_edit.php > > Modified: branches/8.x/tiki-wikiplugin_edit.php > =================================================================== > --- branches/8.x/tiki-wikiplugin_edit.php 2011-11-07 19:36:26 UTC (rev 38743) > +++ branches/8.x/tiki-wikiplugin_edit.php 2011-11-07 19:41:48 UTC (rev 38744) > @@ -59,7 +59,9 @@ > > $parts = array(); > foreach ( $values as $key => $value ) { > - $parts[] = "$key=\"" . str_replace( '"', "\\\"", $value ) . '"'; > + if ($value) { > + $parts[] = "$key=\"" . str_replace( '"', "\\\"", $value ) . '"'; > + } > } > > $params = implode( ' ', $parts ); |