From 3494001aba029f7ba6c349c5370d711babb4c534 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 9 Jan 2001 20:19:24 +0000 Subject: [PATCH] better sanity checking --- cvar.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cvar.php b/cvar.php index 658b245..0c5d96a 100644 --- a/cvar.php +++ b/cvar.php @@ -36,19 +36,19 @@ printArray ($cvar_list, $program); } - if (strchr ($program, '.') || strchr ($program, '/')) { - echo 'Go away.'; - return; + if (strchr ($program, '.') || strchr ($program, '/') || !is_file ('doc/' . $program . '-cvar.txt')) { + echo 'no such program.'; + } else { + tableBoxHeader ('black', tableHeadColor); + tableTitle ("cvar flags", 2, tableHeadColor); + echo 'rread only. Must be set on command line or in the config file.'; + echo '*Archived. Will be saved to config.cfg.'; + echo 'uUserinfo. Changes will be sent to the server.'; + echo 'sServerinfo. Changes will be sent to the clients.'; + tableBoxFooter (); + echo '

'; + printCvarlist ($program); } - tableBoxHeader ('black', tableHeadColor); - tableTitle ("cvar flags", 2, tableHeadColor); - echo 'rread only. Must be set on command line or in the config file.'; - echo '*Archived. Will be saved to config.cfg.'; - echo 'uUserinfo. Changes will be sent to the server.'; - echo 'sServerinfo. Changes will be sent to the clients.'; - tableBoxFooter (); - echo '

'; - printCvarlist ($program); ?>