2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // $Id: md5.inc.php,v 1.6 2004/11/28 13:20:23 henoheno Exp $
6 define('PLUGIN_MD5_LIMIT_LENGTH', 512);
8 function plugin_md5_action()
10 global $script, $get, $post;
13 $key = isset($post['key']) ? $post['key'] : '';
15 plugin_md5_checklimit($key);
16 // Compute (Don't show its $key at the same time)
17 return array('msg'=>'MD5', 'body'=>'Hash: ' . md5($key));
19 // If cmd=md5&md5=password, set only (Don't compute)
20 $value = isset($get['md5']) ? $get['md5'] : '';
22 plugin_md5_checklimit($value);
23 $value = 'value="' . htmlspecialchars($value) . '" ';
26 <form action="$script" method="post">
28 <input type="hidden" name="plugin" value="md5" />
29 <input type="text" name="key" size="30" $value/>
30 <input type="submit" value="Compute" />
35 return array('msg'=>'MD5', 'body'=>$form);
39 function plugin_md5_checklimit($text)
41 if (strlen($text) > PLUGIN_MD5_LIMIT_LENGTH)
42 die_message('Limit: malicious message length');