Revisión | e07ed5a4cb117a077244a2d8e34e1a31cc23a54f (tree) |
---|---|
Tiempo | 2005-02-06 23:21:40 |
Autor | henoheno <henoheno> |
Commiter | henoheno |
Cleanup. Remove warnings
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: amazon.inc.php,v 1.11 2004/12/28 15:12:25 henoheno Exp $ | |
3 | +// $Id: amazon.inc.php,v 1.12 2005/02/06 14:21:40 henoheno Exp $ | |
4 | 4 | // Id: amazon.inc.php,v 1.1 2003/07/24 13:00:00 閑舎 |
5 | 5 | // |
6 | 6 | // Amazon plugin: Book-review maker via amazon.com/amazon.jp |
@@ -121,7 +121,7 @@ function plugin_amazon_convert() | ||
121 | 121 | } else if (func_num_args() == 0) { |
122 | 122 | // レビュー作成 |
123 | 123 | $s_page = htmlspecialchars($vars['page']); |
124 | - if ($s_page == '') $s_page = $vars['refer']; | |
124 | + if ($s_page == '') $s_page = isset($vars['refer']) ? $vars['refer'] : ''; | |
125 | 125 | $ret = <<<EOD |
126 | 126 | <form action="$script" method="post"> |
127 | 127 | <div> |
@@ -186,11 +186,12 @@ function plugin_amazon_action() | ||
186 | 186 | global $vars, $script, $edit_auth, $edit_auth_users; |
187 | 187 | global $amazon_body, $asin, $asin_all; |
188 | 188 | |
189 | - $asin_all = htmlspecialchars(rawurlencode(strip_bracket($vars['asin']))); | |
189 | + $asin_all = isset($vars['asin']) ? | |
190 | + htmlspecialchars(rawurlencode(strip_bracket($vars['asin']))) : ''; | |
190 | 191 | |
191 | 192 | if (! is_asin()) { |
192 | 193 | $retvars['msg'] = 'ブックレビュー編集'; |
193 | - $retvars['refer'] = $vars['refer']; | |
194 | + $retvars['refer'] = isset($vars['refer']) ? $vars['refer'] : ''; | |
194 | 195 | $retvars['body'] = plugin_amazon_convert(); |
195 | 196 | return $retvars; |
196 | 197 |
@@ -198,11 +199,11 @@ function plugin_amazon_action() | ||
198 | 199 | $s_page = $vars['refer']; |
199 | 200 | $r_page = $s_page . '/' . $asin; |
200 | 201 | $r_page_url = rawurlencode($r_page); |
202 | + $auth_user = isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : ''; | |
201 | 203 | |
202 | 204 | pkwk_headers_sent(); |
203 | - if ($edit_auth && (! isset($_SERVER['PHP_AUTH_USER']) || | |
204 | - ! array_key_exists($_SERVER['PHP_AUTH_USER'], $edit_auth_users) || | |
205 | - $edit_auth_users[$_SERVER['PHP_AUTH_USER']] != $_SERVER['PHP_AUTH_PW'])) { | |
205 | + if ($edit_auth && ($auth_user == '' || ! isset($edit_auth_users[$auth_user]) || | |
206 | + $edit_auth_users[$auth_user] != $_SERVER['PHP_AUTH_PW'])) { | |
206 | 207 | header('Location: ' . get_script_uri() . '?cmd=read&page=' . $r_page_url); |
207 | 208 | } else { |
208 | 209 | $title = plugin_amazon_get_asin_title(); |
@@ -444,7 +445,7 @@ function is_asin() | ||
444 | 445 | return FALSE; |
445 | 446 | } else { |
446 | 447 | $asin = $tmpary[1]; |
447 | - $asin_ext = $tmpary[2]; | |
448 | + $asin_ext = isset($tmpary[2]) ? $tmpary[2] : ''; | |
448 | 449 | if ($asin_ext == '') $asin_ext = '09'; |
449 | 450 | $asin_all = $asin . $asin_ext; |
450 | 451 | return TRUE; |