Overview
Comment:Return user error on invalid skeleton name
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: 796d364398e3a8d7be2cf3fd43a2ce092b9b5d4035db636c9ddac371af24be8d
User & Date: bohwaz on 2021-04-18 13:02:01
Other Links: manifest | tags
Context
2021-04-18
13:02
Accept NULL strings check-in: 237e0b0809 user: bohwaz tags: trunk, stable
13:02
Return user error on invalid skeleton name check-in: 796d364398 user: bohwaz tags: trunk, stable
12:53
Fix redirect in http function check-in: 80b2aca31a user: bohwaz tags: trunk, stable
Changes

Modified src/www/admin/web/config.php from [89593518e0] to [3dd1c46ed9].

37
38
39
40
41
42
43







44
45
46
47
48
49
50
51
52
53
	$form->runIf('save', function () use ($source) {
		$tpl = new Skeleton($source);
		$tpl->edit(f('content'));
		$fullscreen = null !== qg('fullscreen') ? '#fullscreen' : '';
		Utils::redirect(Utils::getSelfURI(sprintf('edit=%s&ok%s', rawurlencode($source), $fullscreen)));
	}, $csrf_key);








	$tpl->assign('edit', ['file' => $source, 'content' => (new Skeleton($source))->raw()]);
	$tpl->assign('csrf_key', $csrf_key);
}

$tpl->assign('sources', Skeleton::list());

$tpl->assign('reset_ok', qg('reset_ok') !== null);
$tpl->assign('ok', qg('ok') !== null);

$tpl->display('web/config.tpl');







>
>
>
>
>
>
>
|









37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
	$form->runIf('save', function () use ($source) {
		$tpl = new Skeleton($source);
		$tpl->edit(f('content'));
		$fullscreen = null !== qg('fullscreen') ? '#fullscreen' : '';
		Utils::redirect(Utils::getSelfURI(sprintf('edit=%s&ok%s', rawurlencode($source), $fullscreen)));
	}, $csrf_key);

	try {
		$skel = new Skeleton($source);
	}
	catch (\InvalidArgumentException $e) {
		throw new UserException('Nom de squelette invalide');
	}

	$tpl->assign('edit', ['file' => $source, 'content' => $skel->raw()]);
	$tpl->assign('csrf_key', $csrf_key);
}

$tpl->assign('sources', Skeleton::list());

$tpl->assign('reset_ok', qg('reset_ok') !== null);
$tpl->assign('ok', qg('ok') !== null);

$tpl->display('web/config.tpl');