2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // $Id: md5.inc.php,v 1.7 2005/01/23 05:29:10 henoheno Exp $
6 define('PLUGIN_MD5_LIMIT_LENGTH', 512);
8 function plugin_md5_action()
10 global $script, $get, $post;
12 if (PKWK_SAFE_MODE || PKWK_READONLY) die_message('Prohibited');
15 $key = isset($post['key']) ? $post['key'] : '';
17 plugin_md5_checklimit($key);
18 // Compute (Don't show its $key at the same time)
19 return array('msg'=>'MD5', 'body'=>'Hash: ' . md5($key));
21 // If cmd=md5&md5=password, set only (Don't compute)
22 $value = isset($get['md5']) ? $get['md5'] : '';
24 plugin_md5_checklimit($value);
25 $value = 'value="' . htmlspecialchars($value) . '" ';
28 <form action="$script" method="post">
30 <input type="hidden" name="plugin" value="md5" />
31 <input type="text" name="key" size="30" $value/>
32 <input type="submit" value="Compute" />
37 return array('msg'=>'MD5', 'body'=>$form);
41 function plugin_md5_checklimit($text)
43 if (strlen($text) > PLUGIN_MD5_LIMIT_LENGTH)
44 die_message('Limit: malicious message length');