Przeglądaj źródła

empty would do the same of isset && ==0

Signed-off-by: emanuele <[email protected]>
emanuele 11 lat temu
rodzic
commit
6a68c1491a
2 zmienionych plików z 3 dodań i 1 usunięć
  1. 1 1
      Sources/Subs-Post.php
  2. 2 0
      Themes/default/index.template.php

+ 1 - 1
Sources/Subs-Post.php

@@ -1829,7 +1829,7 @@ function createPost(&$msgOptions, &$topicOptions, &$posterOptions)
 	$new_topic = empty($topicOptions['id']);
 
 	$message_columns = array(
-		'id_board' => 'int', 'id_topic' => 'int', 'id_member' => 'int', 'subject' => 'string-255', 'body' => (!empty($modSettings['max_messageLength']) && $modSettings['max_messageLength'] > 65534 ? 'string-' . $modSettings['max_messageLength'] : (isset($modSettings['max_messageLength']) && $modSettings['max_messageLength'] == 0 ? 'string' : 'string-65534')),
+		'id_board' => 'int', 'id_topic' => 'int', 'id_member' => 'int', 'subject' => 'string-255', 'body' => (!empty($modSettings['max_messageLength']) && $modSettings['max_messageLength'] > 65534 ? 'string-' . $modSettings['max_messageLength'] : (empty($modSettings['max_messageLength']) ? 'string' : 'string-65534')),
 		'poster_name' => 'string-255', 'poster_email' => 'string-255', 'poster_time' => 'int', 'poster_ip' => 'string-255',
 		'smileys_enabled' => 'int', 'modified_name' => 'string', 'icon' => 'string-16', 'approved' => 'int',
 	);

+ 2 - 0
Themes/default/index.template.php

@@ -584,6 +584,8 @@ function template_button_strip($button_strip, $direction = '', $strip_options =
 	$buttons = array();
 	foreach ($button_strip as $key => $value)
 	{
+		// @todo this check here doesn't make much sense now (from 2.1 on), it should be moved to where the button array is generated
+		// Kept for backward compatibility
 		if (!isset($value['test']) || !empty($context[$value['test']]))
 			$buttons[] = '
 				<li><a' . (isset($value['id']) ? ' id="button_strip_' . $value['id'] . '"' : '') . ' class="button_strip_' . $key . (isset($value['active']) ? ' active' : '') . '" href="' . $value['url'] . '"' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '><span>' . $txt[$value['text']] . '</span></a></li>';