From: benoitg@users.sourceforge.net - 2024-10-01 21:13:49
|
Revision: 86707 http://sourceforge.net/p/tikiwiki/code/86707 Author: "benoitg" Date: 2024-10-01 21:13:47 +0000 (Tue, 01 Oct 2024) Log Message: ----------- [FIX] Tiki Theme Control: Handle no category or section selected on delete in theme control --- * [FIX] handle no category selected on delete in theme control See merge request tikiwiki/tiki!5910 Modified Paths: -------------- trunk/tiki-theme_control.php trunk/tiki-theme_control_sections.php Property Changed: ---------------- trunk/ Index: trunk =================================================================== --- trunk 2024-10-01 21:04:57 UTC (rev 86706) +++ trunk 2024-10-01 21:13:47 UTC (rev 86707) Property changes on: trunk ___________________________________________________________________ Deleted: subgit:lock:9d8e7fcd63d7086ae06d997a7445ba799b566d15 ## -1 +0,0 ## -2024-10-01T20:36:44.537 \ No newline at end of property Added: subgit:lock:dff20032762a6b5736fcaa446fddff4020980f61 ## -0,0 +1 ## +2024-10-01T21:13:46.792 \ No newline at end of property Modified: trunk/tiki-theme_control.php =================================================================== --- trunk/tiki-theme_control.php 2024-10-01 21:04:57 UTC (rev 86706) +++ trunk/tiki-theme_control.php 2024-10-01 21:13:47 UTC (rev 86707) @@ -63,8 +63,12 @@ } if (isset($_REQUEST['delete'])) { $access->checkCsrf(); - foreach (array_keys($_REQUEST['categoryIds']) as $cat) { - $themecontrollib->tc_remove_cat($cat); + if (isset($_REQUEST['categoryIds']) && is_array($_REQUEST['categoryIds'])) { + foreach (array_keys($_REQUEST['categoryIds']) as $cat) { + $themecontrollib->tc_remove_cat($cat); + } + } else { + Feedback::error(tr('No category selected.')); } } Modified: trunk/tiki-theme_control_sections.php =================================================================== --- trunk/tiki-theme_control_sections.php 2024-10-01 21:04:57 UTC (rev 86706) +++ trunk/tiki-theme_control_sections.php 2024-10-01 21:13:47 UTC (rev 86707) @@ -40,8 +40,12 @@ } if (isset($_REQUEST['delete'])) { $access->checkCsrf(); - foreach (array_keys($_REQUEST["sec"]) as $sec) { - $themecontrollib->tc_remove_section($sec); + if (isset($_REQUEST["sec"]) && is_array($_REQUEST["sec"])) { + foreach (array_keys($_REQUEST["sec"]) as $sec) { + $themecontrollib->tc_remove_section($sec); + } + } else { + Feedback::error(tr('No section selected.')); } } $channels = $themecontrollib->tc_list_sections(0, -1, 'section_asc', ''); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |