onokazu
onoka****@users*****
2005年 8月 31日 (水) 05:21:54 JST
Index: xoops2jp/html/misc.php diff -u xoops2jp/html/misc.php:1.4.2.1 xoops2jp/html/misc.php:1.4.2.2 --- xoops2jp/html/misc.php:1.4.2.1 Thu Aug 25 12:15:31 2005 +++ xoops2jp/html/misc.php Wed Aug 31 05:21:54 2005 @@ -1,5 +1,5 @@ <?php -// $Id: misc.php,v 1.4.2.1 2005/08/25 03:15:31 minahito Exp $ +// $Id: misc.php,v 1.4.2.2 2005/08/30 20:21:54 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -102,19 +102,15 @@ echo '</tr></table></form></div>'; break; case "friend": + if (!is_object($xoopsUser)) { + break; + } if ( !isset($_POST['op']) || $_POST['op'] == "sendform" ) { $token=&XoopsMultiTokenHandler::quickCreate('misc_sendform'); - if (is_object($xoopsUser)) { - $yname = $xoopsUser->getVar("uname", 'e'); - $ymail = $xoopsUser->getVar("email", 'e'); - $fname = ""; - $fmail = ""; - } else { - $yname = ""; - $ymail = ""; - $fname = ""; - $fmail = ""; - } + $yname = $xoopsUser->getVar("uname", 'e'); + $ymail = $xoopsUser->getVar("email", 'e'); + $fname = ""; + $fmail = ""; printCheckForm(); echo '</head><body> <form action="'.XOOPS_URL.'/misc.php" method="post" onsubmit="return checkForm();"><table width="100%" class="outer" cellspacing="1"><tr><th colspan="2">'._MSC_RECOMMENDSITE.'</th></tr>'; @@ -135,11 +131,7 @@ exit(); } $myts =& MyTextsanitizer::getInstance(); - if (is_object($xoopsUser)) { - $ymail = $xoopsUser->getVar("email"); - } else { - $ymail = isset($_POST['ymail']) ? $myts->stripSlashesGPC(trim($_POST['ymail'])) : ''; - } + $ymail = $xoopsUser->getVar("email"); if ( !isset($_POST['yname']) || trim($_POST['yname']) == "" || $ymail == '' || !isset($_POST['fname']) || trim($_POST['fname']) == "" || !isset($_POST['fmail']) || trim($_POST['fmail']) == '' ) { redirect_header(XOOPS_URL."/misc.php?action=showpopups&type=friend&op=sendform",2,_MSC_NEEDINFO); exit();