Procházet zdrojové kódy

! If either the karma smite or applaud labels are empty, don't permit that operation (e.g. emptying the smite label to 'stop' smiting)

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer před 10 roky
rodič
revize
248fdf0d2f
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. 3 0
      Sources/Karma.php

+ 3 - 0
Sources/Karma.php

@@ -53,6 +53,9 @@ function ModifyKarma()
 	// Applauding or smiting?
 	$dir = $_REQUEST['sa'] != 'applaud' ? -1 : 1;
 
+	if (($dir == 1 && empty($modSettings['karmaApplaudLabel'])) || ($dir == -1 && empty($modSettings['karmaSmiteLabel'])))
+		fatal_lang_error('feature_disabled', false);
+
 	// Delete any older items from the log. (karmaWaitTime is by hour.)
 	$smcFunc['db_query']('', '
 		DELETE FROM {db_prefix}log_karma