Skip to content
View in the app

A better way to browse. Learn more.

MagicDuel Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

mds_template() crashes on false

Featured Replies

The mds_template() function crashes on any value that evaluates to false:

 

Example:

[spoiler]
content:

Template values:<br/>
0:[[zero]]<br/>
'0':[[zerostring]]<br/>
'':[[mptystring]]<br/>
null:[[null]]<br/>
FALSE:[[false]]<br/>
' ':[[space]]<br/>

 
code:

(locations 1_-1x2_1)
@tpl['zero'] = 0;
@tpl['zerostring'] = '0';
@tpl['mptystring'] = '';
@tpl['null'] = null;
@tpl['false'] = FALSE;
@tpl['space'] = ' ';
mds_template(@content[0], @tpl);

 
output:
 

#Could not find matching value for template keyword '[[zero]]'.
#Could not find matching value for template keyword '[[zerostring]]'.
#Could not find matching value for template keyword '[[mptystring]]'.
#Could not find matching value for template keyword '[[null]]'.
#Could not find matching value for template keyword '[[false]]'.


[/spoiler]

 

It seems like there is an isset() missing in the template code.

 

One way to work around this is by appending a space to each value to make sure they are no longer empty. (As extra spaces are normally ignored in HTML)

  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Forum Statistics

  • Total Topics 17.5k
  • Total Posts 182.2k

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.