r102484 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102483‎ | r102484 | r102485 >
Date:02:48, 9 November 2011
Author:yaron
Status:resolved (Comments)
Tags:
Comment:
Fix for r102368 - apparently, the is_null() check was necessary; replaced the checks with calls to empty()
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_FormStart.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php
@@ -65,7 +65,7 @@
6666 // This form can be used to create a sub-page for an
6767 // existing page
6868
69 - if ( $super_page !== '' ) {
 69+ if ( !empty( $super_page ) ) {
7070 $page_name = "$super_page/$page_name";
7171 }
7272
@@ -173,7 +173,7 @@
174174 }
175175 }
176176
177 - if ( $params !== '' ) {
 177+ if ( !empty( $params ) ) {
178178 $redirect_url .= ( strpos( $redirect_url, '?' ) > - 1 ) ? '&' : '?';
179179 $redirect_url .= $params;
180180 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r103129Follow-up to r102484 and r102485 - as aesthetically unappealing as it is, it ...yaron04:33, 15 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102368Follow up to r102365;jeroendedauw02:46, 8 November 2011
r102481Partial revert of r102368 - I'm pretty sure the additional is_null() checks a...yaron02:27, 9 November 2011

Comments

#Comment by Nikerabbit (talk | contribs)   08:34, 9 November 2011

No you are back in to the original situation where "00" doesn't work. I would suggest trim( $foo ) !== , or if true should not be interpreted as 1, add is_string() check too.

#Comment by Yaron Koren (talk | contribs)   20:09, 9 November 2011

Ah, I didn't think about the "0" thing... the problem was that sometimes the value is null, and sometimes it's blank - which is why I wanted to use empty(), to have just one call in the "if" statement, instead of two - but maybe it'll have to be two.

Status & tagging log