|
From: <rgr...@us...> - 2014-01-21 17:10:09
|
Revision: 12271
http://sourceforge.net/p/xoops/svn/12271
Author: rgriffith
Date: 2014-01-21 17:10:06 +0000 (Tue, 21 Jan 2014)
Log Message:
-----------
Cleanup for #1271 - fix some installer issues
Supress expected warnings for cleaner appearance
Optimize detection of install condition in /index.php (will generate warning when /mainfile.php is not found)
Protector icon date warning
Disparity in parameter expectation between page_end and cleanup
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/index.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/install/cleanup.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/install/include/common.inc.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/install/include/install_tpl.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_end.php
XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/module_icon.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/index.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/index.php 2014-01-20 16:42:38 UTC (rev 12270)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/index.php 2014-01-21 17:10:06 UTC (rev 12271)
@@ -19,12 +19,12 @@
* @version $Id$
*/
-$mainfile = dirname(__FILE__) . '/mainfile.php';
-if (file_exists($mainfile)) {
- include $mainfile;
-} elseif (file_exists(dirname(__FILE__) . '/install/index.php')) {
- header('Location: install/index.php');
- exit;
+include dirname(__FILE__) . '/mainfile.php';
+if (!defined('XOOPS_MAINFILE_INCLUDED')) {
+ if (file_exists(dirname(__FILE__) . '/install/index.php')) {
+ header('Location: install/index.php');
+ exit;
+ }
}
$xoopsPreload =& XoopsPreload::getInstance();
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/install/cleanup.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/install/cleanup.php 2014-01-20 16:42:38 UTC (rev 12270)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/install/cleanup.php 2014-01-21 17:10:06 UTC (rev 12271)
@@ -28,7 +28,7 @@
defined('XOOPS_INSTALL') or die('XOOPS Installation wizard die');
$install_rename_suffix = $_POST['instsuffix'];
-if (preg_match('/^[a-z0-9]{23}$/', $install_rename_suffix)) {
+if (preg_match('/^[a-f0-9]{23}$/', $install_rename_suffix)) {
$installer_modified = "install_remove_" . $install_rename_suffix;
install_finalize($installer_modified);
echo "OK";
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/install/include/common.inc.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/install/include/common.inc.php 2014-01-20 16:42:38 UTC (rev 12270)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/install/include/common.inc.php 2014-01-21 17:10:06 UTC (rev 12271)
@@ -39,7 +39,7 @@
$xoopsOption['nocommon'] = true;
session_start();
}
-include_once '../mainfile.php';
+@include '../mainfile.php';
if (!defined("XOOPS_ROOT_PATH")) {
define("XOOPS_ROOT_PATH", str_replace("\\", "/", realpath('../')));
}
@@ -52,6 +52,7 @@
$xoopsLogger->activated = true;
*/
+date_default_timezone_set(@date_default_timezone_get());
include './class/installwizard.php';
include_once '../include/version.php';
include_once './include/functions.php';
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/install/include/install_tpl.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/install/include/install_tpl.php 2014-01-20 16:42:38 UTC (rev 12270)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/install/include/install_tpl.php 2014-01-21 17:10:06 UTC (rev 12271)
@@ -157,7 +157,7 @@
<script type="text/javascript">
function ajaxCleanup()
{
- new Ajax.Request(<?php echo "'".XOOPS_URL."/install/cleanup.php'"; ?>, {
+ new Ajax.Request(<?php echo "'".@constant('XOOPS_URL')."/install/cleanup.php'"; ?>, {
method: 'post',
parameters: {instsuffix: <?php echo isset($install_rename_suffix)?"'".$install_rename_suffix."'":"''"; ?> }
});
@@ -169,6 +169,6 @@
**/
var filename = location.pathname.substring(location.pathname.lastIndexOf('/')+1);
if (filename === 'page_end.php') {
- Event.observe(window,"load",ajaxCleanup);
+ Event.observe(window, 'load', ajaxCleanup);
}
</script>
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_end.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_end.php 2014-01-20 16:42:38 UTC (rev 12270)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/install/page_end.php 2014-01-21 17:10:06 UTC (rev 12271)
@@ -31,9 +31,8 @@
setcookie('xo_install_user', '', null, null, null);
defined('XOOPS_INSTALL') or die('XOOPS Installation wizard die');
-$install_rename_suffix = uniqid(mt_rand());
+$install_rename_suffix = uniqid(substr(md5($x = mt_rand()) . $x, -10));
$installer_modified = "install_remove_" . $install_rename_suffix;
-//register_shutdown_function('install_finalize', $installer_modified);
$pageHasForm = false;
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/module_icon.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/module_icon.php 2014-01-20 16:42:38 UTC (rev 12270)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/xoops_lib/modules/protector/module_icon.php 2014-01-21 17:10:06 UTC (rev 12271)
@@ -7,6 +7,7 @@
$mydirpath = $registry->getEntry('mydirpath');
$language = $registry->getEntry('language');
// end hack by Trabis
+date_default_timezone_set(@date_default_timezone_get());
$icon_cache_limit = 3600 ; // default 3600sec == 1hour
|