Quellcode durchsuchen

! Let's cache the file_exists too (Subs-Editor.php => messageicons)...why do we check it?

emanuele vor 12 Jahren
Ursprung
Commit
5d06ba438b
1 geänderte Dateien mit 13 neuen und 13 gelöschten Zeilen
  1. 13 13
      Sources/Subs-Editor.php

+ 13 - 13
Sources/Subs-Editor.php

@@ -986,21 +986,21 @@ function getMessageIcons($board_id)
 				$icon_data[] = $row;
 			$smcFunc['db_free_result']($request);
 
-			cache_put_data('posting_icons-' . $board_id, $icon_data, 480);
-		}
-		else
-			$icon_data = $temp;
+			$icons = array();
+			foreach ($icon_data as $icon)
+			{
+				$icons[$icon['filename']] = array(
+					'value' => $icon['filename'],
+					'name' => $icon['title'],
+					'url' => $settings[file_exists($settings['theme_dir'] . '/images/post/' . $icon['filename'] . '.png') ? 'images_url' : 'default_images_url'] . '/post/' . $icon['filename'] . '.png',
+					'is_last' => false,
+				);
+			}
 
-		$icons = array();
-		foreach ($icon_data as $icon)
-		{
-			$icons[$icon['filename']] = array(
-				'value' => $icon['filename'],
-				'name' => $icon['title'],
-				'url' => $settings[file_exists($settings['theme_dir'] . '/images/post/' . $icon['filename'] . '.png') ? 'images_url' : 'default_images_url'] . '/post/' . $icon['filename'] . '.png',
-				'is_last' => false,
-			);
+			cache_put_data('posting_icons-' . $board_id, $icons, 480);
 		}
+		else
+			$icons = $temp;
 	}
 
 	return array_values($icons);