Browse Source

Prevent ntegrate_modify to change the id of the things it is going to modify

Signed-off-by: emanuele <[email protected]>
emanuele 12 years ago
parent
commit
a6394dea87
3 changed files with 8 additions and 5 deletions
  1. 4 2
      Sources/Subs-Boards.php
  2. 0 1
      Sources/Subs-Calendar.php
  3. 4 2
      Sources/Subs-Categories.php

+ 4 - 2
Sources/Subs-Boards.php

@@ -483,7 +483,8 @@ function modifyBoard($board_id, &$boardOptions)
 	if (!isset($boards[$board_id]) || (isset($boardOptions['target_board']) && !isset($boards[$boardOptions['target_board']])) || (isset($boardOptions['target_category']) && !isset($cat_tree[$boardOptions['target_category']])))
 		fatal_lang_error('no_board');
 
-	call_integration_hook('integrate_pre_modify_board', array($board_id, &$boardOptions));
+	$id = $board_id;
+	call_integration_hook('integrate_pre_modify_board', array($id, &$boardOptions));
 
 	// All things that will be updated in the database will be in $boardUpdates.
 	$boardUpdates = array();
@@ -662,7 +663,8 @@ function modifyBoard($board_id, &$boardOptions)
 		$boardUpdateParameters['num_posts'] = (int) $boardOptions['num_posts'];
 	}
 
-	call_integration_hook('integrate_modify_board', array($board_id, &$boardUpdates, &$boardUpdateParameters));
+	$id = $board_id;
+	call_integration_hook('integrate_modify_board', array($id, &$boardUpdates, &$boardUpdateParameters));
 
 	// Do the updates (if any).
 	if (!empty($boardUpdates))

+ 0 - 1
Sources/Subs-Calendar.php

@@ -936,7 +936,6 @@ function modifyEvent($event_id, &$eventOptions)
 
 	// This is to prevent hooks to modify the id of the event
 	$real_event_id = $event_id;
-
 	call_integration_hook('integrate_modify_event', array($event_id, &$eventOptions, &$event_columns, &$event_parameters));
 
 	$smcFunc['db_query']('', '

+ 4 - 2
Sources/Subs-Categories.php

@@ -31,7 +31,8 @@ function modifyCategory($category_id, $catOptions)
 	$catUpdates = array();
 	$catParameters = array();
 
-	call_integration_hook('integrate_pre_modify_category', array($category_id, &$catOptions));
+	$cat_id = $category_id;
+	call_integration_hook('integrate_pre_modify_category', array($cat_id, &$catOptions));
 
 	// Wanna change the categories position?
 	if (isset($catOptions['move_after']))
@@ -93,7 +94,8 @@ function modifyCategory($category_id, $catOptions)
 		$catParameters['is_collapsible'] = $catOptions['is_collapsible'] ? 1 : 0;
 	}
 
-	call_integration_hook('integrate_modify_category', array($category_id, &$catUpdates, &$catParameters));
+	$cat_id = $category_id;
+	call_integration_hook('integrate_modify_category', array($cat_id, &$catUpdates, &$catParameters));
 
 	// Do the updates (if any).
 	if (!empty($catUpdates))