Explorar o código

Explicit unset of a by-reference variable, to avoid a weird side-effects (thanks to Mallory Desaintes for spotting this one).

jkbockstael %!s(int64=14) %!d(string=hai) anos
pai
achega
fd5dc42e5e
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      main/course_info/infocours.php

+ 1 - 0
main/course_info/infocours.php

@@ -297,6 +297,7 @@ if ($form->validate() && is_settings_editable()) {
 	foreach ($update_values as $index => & $value) {
 		$update_values[$index] = Database::escape_string($value);
 	}
+	unset($value);
 	$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
 	$sql = "UPDATE $table_course SET
 				title 				= '".Security::remove_XSS($update_values['title'])."',