<commit_before><?php
/**
 * @package tikiwiki
 */
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

require_once ('tiki-setup.php');
include_once ('lib/categories/categlib.php');

$access->check_feature('feature_categories');
// Check for parent category or set to 0 if not present
if (!empty($_REQUEST['parentId']) && !($info = $categlib->get_category($_REQUEST['parentId']))) {
	$smarty->assign('msg', 'Incorrect param'.' parentId');
	$smarty->display('error.tpl');
	die;
}	

if (!isset($_REQUEST['parentId'])) {
	$_REQUEST['parentId'] = 0;
}
$smarty->assign('parentId', $_REQUEST['parentId']);


$access->check_permission('tiki_p_admin_categories', '', 'category', $_REQUEST['parentId']);

if (!empty($_REQUEST['unassign'])) {
	$access->check_authenticity(tra('Are you sure you want to unassign the objects of this category: ') . $info['name']);
	$categlib->unassign_all_objects($_REQUEST['parentId']);
}
if (!empty($_REQUEST['move_to']) && !empty($_REQUEST['toId'])) {
	check_ticket('admin-categories');
	if (!$categlib->get_category($_REQUEST['toId'])) {
		$smarty->assign('msg', 'Incorrect param'.' toId');<commit_msg>[FIX] category admin: Seems the pagination has been very broken on this page for a long time (see r30064) and now almost every object gets loaded (fully) on each page load, leading to WSoD on large sites, so try and set the memory and timeout to unlimited so at least something appears eventually (if php settings allow)<commit_after><?php
/**
 * @package tikiwiki
 */
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

require_once ('tiki-setup.php');
include_once ('lib/categories/categlib.php');

@ini_set('max_execution_time', 0);	// as pagination is broken and almost every object gets fully loaded on this page
@ini_set('memory_limit', -1);		// at least try and avoid WSoD on large sites (TODO better still - see r30064)

$access->check_feature('feature_categories');
// Check for parent category or set to 0 if not present
if (!empty($_REQUEST['parentId']) && !($info = $categlib->get_category($_REQUEST['parentId']))) {
	$smarty->assign('msg', 'Incorrect param'.' parentId');
	$smarty->display('error.tpl');
	die;
}	

if (!isset($_REQUEST['parentId'])) {
	$_REQUEST['parentId'] = 0;
}
$smarty->assign('parentId', $_REQUEST['parentId']);


$access->check_permission('tiki_p_admin_categories', '', 'category', $_REQUEST['parentId']);

if (!empty($_REQUEST['unassign'])) {
	$access->check_authenticity(tra('Are you sure you want to unassign the objects of this category: ') . $info['name']);
	$categlib->unassign_all_objects($_REQUEST['parentId']);
}
if (!empty($_REQUEST['move_to']) && !empty($_REQUEST['toId'])) {
	check_ticket('admin-categories');
	if (!$categlib->get_category($_REQUEST['toId'])) {
		$smarty->assign('msg', 'Incorrect param'.' toId');
{'fraction_non_alphanumeric': 0.17181166198939818, 'fraction_numerical': 0.009978172747115684, 'mean_word_length': 5.796610169491525, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4007513', 'n_tokens_mistral': 1026, 'n_tokens_neox': 974, 'n_words': 291}