From: SourceForge.net <no...@so...> - 2005-04-08 08:09:23
|
Bugs item #1164226, was opened at 2005-03-16 06:17 Message generated for change (Comment added) made by mithyt2 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=430840&aid=1164226&group_id=41586 Category: Core - Core Group: XOOPS 2.2.x >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Sudhaker Raj (sudhaker) Assigned to: Jan Pedersen (mithyt2) Summary: improvement in function xoops_refcheck Initial Comment: In version 2.0.9.2, a minor bug is always returning false from xoops_refcheck which is preventing writing of cache/adminmenu.php and hence not allowing entering into admin control panel. My Xoops is installed on muti-domain site (but same database) and I used XOOPS_URL as '/x2' in place of the default 'http://xoops.biz/x2'. After little debug, I found problem at line #146 of include/functions.php . I commented the original one and added my modified code and this is working with abbreviated XOOPS_URL even. //if (strpos($ref, XOOPS_URL) !== 0 ) { // return false; //} $pref = parse_url($ref); if ( $pref['host'] != $_SERVER['HTTP_HOST'] ) { return false; } I implemented the change and tested it. working perfectly :-) I don't see any solid reason of making the xoops installation domain specific. If we get this change merged in next release, doing muti-domain xoops hosting will be just matter of abbreviating XOOPS_URL. Thanks, ---------------------------------------------------------------------- Comment By: Jan Pedersen (mithyt2) Date: 2005-04-08 10:09 Message: Logged In: YES user_id=841117 Fixed in CVS and waiting for review before merging to the trunk. ---------------------------------------------------------------------- Comment By: Sudhaker Raj (sudhaker) Date: 2005-03-25 17:03 Message: Logged In: YES user_id=635765 We should also encourage module developers to use this function. I have seen some module doing their own ref_check with similar issues. FYI: I have already added this to 'Xoop VUF' at dev Wiki. ---------------------------------------------------------------------- Comment By: Jan Pedersen (mithyt2) Date: 2005-03-25 14:26 Message: Logged In: YES user_id=841117 OK, I'll take care of this one personally. ---------------------------------------------------------------------- Comment By: Sudhaker Raj (sudhaker) Date: 2005-03-18 17:05 Message: Logged In: YES user_id=635765 Oops - $_SERVER['HTTP_HOST'] is returning port component too :-/ This will work in non-default port scenario too. //if (strpos($ref, XOOPS_URL) !== 0 ) { // return false; //} // start abbreviated XOOPS_URL hack SRAJ $pref = parse_url($ref); if (strpos( $_SERVER['HTTP_HOST'], $pref['host']) !== 0) { return false; } // end hack ---------------------------------------------------------------------- Comment By: Sudhaker Raj (sudhaker) Date: 2005-03-18 17:05 Message: Logged In: YES user_id=635765 Oops - $_SERVER['HTTP_HOST'] is returning port component too :-/ This will work in non-default port scenario too. //if (strpos($ref, XOOPS_URL) !== 0 ) { // return false; //} // start abbreviated XOOPS_URL hack SRAJ $pref = parse_url($ref); if (strpos( $_SERVER['HTTP_HOST'], $pref['host']) !== 0) { return false; } // end hack ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=430840&aid=1164226&group_id=41586 |