[geeklog-hg] geeklog: Merged with upstream
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Fri Jan 18 10:27:56 EST 2013
changeset 8920:72ae2802e9fe
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/72ae2802e9fe
user: Tom <websitemaster at cogeco.net>
date: Fri Jan 18 10:27:00 2013 -0500
description:
Merged with upstream
diffstat:
plugins/links/functions.inc | 2 +-
plugins/polls/functions.inc | 2 +-
public_html/admin/install/index.php | 9 +-
public_html/admin/install/lib-install.php | 34 +++++++++-
public_html/admin/install/lib-upgrade.php | 23 -------
public_html/admin/install/migrate.php | 34 +++++-----
public_html/admin/plugins.php | 3 -
public_html/layout/modern_curve/javascript/search.js | 7 ++
system/classes/search.class.php | 4 +-
system/databases/mysql.class.php | 58 ++++++++++++++++++-
system/databases/mysqli.class.php | 61 ++++++++++++++++++-
11 files changed, 173 insertions(+), 64 deletions(-)
diffs (truncated from 598 to 300 lines):
diff -r 3c3e13784e1b -r 72ae2802e9fe plugins/links/functions.inc
--- a/plugins/links/functions.inc Fri Jan 18 10:25:49 2013 -0500
+++ b/plugins/links/functions.inc Fri Jan 18 10:27:00 2013 -0500
@@ -720,7 +720,7 @@
if (isset($_UPDATES[$current_version])) {
$_SQL = $_UPDATES[$current_version];
- $_SQL = INST_checkInnodbUpgrade($_SQL);
+
foreach ($_SQL as $sql) {
DB_query($sql);
}
diff -r 3c3e13784e1b -r 72ae2802e9fe plugins/polls/functions.inc
--- a/plugins/polls/functions.inc Fri Jan 18 10:25:49 2013 -0500
+++ b/plugins/polls/functions.inc Fri Jan 18 10:27:00 2013 -0500
@@ -1185,7 +1185,7 @@
if (isset($_UPDATES[$current_version])) {
$_SQL = $_UPDATES[$current_version];
- $_SQL = INST_checkInnodbUpgrade($_SQL);
+
foreach ($_SQL as $sql) {
DB_query($sql);
}
diff -r 3c3e13784e1b -r 72ae2802e9fe public_html/admin/install/index.php
--- a/public_html/admin/install/index.php Fri Jan 18 10:25:49 2013 -0500
+++ b/public_html/admin/install/index.php Fri Jan 18 10:27:00 2013 -0500
@@ -421,7 +421,7 @@
require_once $dbconfig_path;
require_once $siteconfig_path;
require_once $_CONF['path_system'] . 'lib-database.php';
-
+
if($_DB_dbms=='pgsql')
{
//Create a func to check if plpgsql is already installed
@@ -518,6 +518,7 @@
$config->set('path_themes', $html_path . 'layout/');
$config->set('rdf_file', $html_path . 'backend/geeklog.rss');
$config->set('path_pear', $_CONF['path_system'] . 'pear/');
+ $config->set('cookie_path', INST_guessCookiePath(urldecode($site_url)));
$config->set_default('default_photo', urldecode($site_url) . '/default.jpg');
$lng = INST_getDefaultLanguage($gl_path . 'language/', $language, $utf8);
@@ -939,10 +940,10 @@
// $display holds all the outputted HTML and content
if (defined('XHTML')) {
- $display = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ $display = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
} else {
- $display = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+ $display = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>';
}
@@ -1216,7 +1217,7 @@
. '<input type="submit" name="install_type" class="button big-button" value="' . $LANG_INSTALL[25] . '"' . XHTML .'>' . LB
. '<input type="submit" name="install_type" class="button big-button" value="' . $LANG_INSTALL[16] . '"' . XHTML .'>' . LB
. '</form> </div> <br' . XHTML . '>' . LB;
-
+
}
break;
diff -r 3c3e13784e1b -r 72ae2802e9fe public_html/admin/install/lib-install.php
--- a/public_html/admin/install/lib-install.php Fri Jan 18 10:25:49 2013 -0500
+++ b/public_html/admin/install/lib-install.php Fri Jan 18 10:27:00 2013 -0500
@@ -560,7 +560,7 @@
$mRetval = false;
}
-
+
return $mRetval;
}
@@ -825,9 +825,6 @@
foreach ($_SQL as $sql) {
$sql = str_replace('#group#', $admin_group_id, $sql);
- if ($use_innodb) {
- $sql = str_replace('MyISAM', 'InnoDB', $sql);
- }
DB_query($sql);
if (DB_error()) {
COM_errorLog('Error creating plugin table', 1);
@@ -913,7 +910,7 @@
if (DB_error()) {
COM_errorLog('Error adding plugin default data', 1);
PLG_uninstall($plugin);
-
+
return false;
}
}
@@ -1042,7 +1039,7 @@
// if we had to fix the site's URL, chances are that cookie domain
// and path are also wrong and the user won't be able to log in
$config->set('cookiedomain', '');
- $config->set('cookie_path', '/');
+ $config->set('cookie_path', INST_guessCookiePath($site_url));
}
if (! empty($site_admin_url) &&
($_CONF['site_admin_url'] != $site_admin_url)) {
@@ -1310,4 +1307,29 @@
}
}
+/**
+* Returns a cookie path for a site URL
+*
+* @param string $site_url site URL
+* @return string a cookie path
+*/
+function INST_guessCookiePath($site_url)
+{
+ $retval = '/';
+
+ if (preg_match('|(^https?://[^/]+)|i', $site_url, $match)) {
+ $path = substr($site_url, strlen($match[1]));
+
+ if (($path !== '') AND ($path !== FALSE)) {
+ $retval = $path;
+
+ if (substr($retval, -1) !== '/') {
+ $retval .= '/';
+ }
+ }
+ }
+
+ return $retval;
+}
+
?>
diff -r 3c3e13784e1b -r 72ae2802e9fe public_html/admin/install/lib-upgrade.php
--- a/public_html/admin/install/lib-upgrade.php Fri Jan 18 10:25:49 2013 -0500
+++ b/public_html/admin/install/lib-upgrade.php Fri Jan 18 10:27:00 2013 -0500
@@ -736,7 +736,6 @@
{
global $progress, $use_innodb, $_DB, $_DB_dbms;
- $_SQL = INST_checkInnodbUpgrade($_SQL);
foreach ($_SQL as $sql) {
$progress .= "executing " . $sql . "<br" . XHTML . ">\n";
if ($_DB_dbms == 'mssql') {
@@ -748,28 +747,6 @@
}
/**
- * Check InnoDB Upgrade
- *
- * @param array $_SQL List of SQL queries
- * @return array InnoDB table style if chosen
- *
- */
-function INST_checkInnodbUpgrade($_SQL)
-{
- global $use_innodb;
-
- if ($use_innodb) {
- $statements = count($_SQL);
- for ($i = 0; $i < $statements; $i++) {
- $_SQL[$i] = str_replace('MyISAM', 'InnoDB', $_SQL[$i]);
- }
- }
-
- return $_SQL;
-}
-
-
-/**
* Check for InnoDB table support (usually as of MySQL 4.0, but may be
* available in earlier versions, e.g. "Max" or custom builds).
*
diff -r 3c3e13784e1b -r 72ae2802e9fe public_html/admin/install/migrate.php
--- a/public_html/admin/install/migrate.php Fri Jan 18 10:25:49 2013 -0500
+++ b/public_html/admin/install/migrate.php Fri Jan 18 10:27:00 2013 -0500
@@ -353,7 +353,7 @@
// Check if there are any files in the backups directory
if (count($backup_files) > 0) {
-
+
$display .= '<select name="backup_file">' . LB
. '<option value="">' . $LANG_MIGRATE[10] . '</option>' . LB;
@@ -369,7 +369,7 @@
. ')</option>' . LB;
}
-
+
$display .= '</select>' . LB;
} else {
@@ -380,7 +380,7 @@
$display .= '</span>' . LB
. '<span id="migration-upload">' . LB ;
-
+
// Check if the user's PHP configuration has 'file_uploads' enabled
$file_uploads = ini_get('file_uploads') ? true : false;
@@ -390,7 +390,7 @@
if ($file_uploads && $is_writable) {
$display .= '<input class="input_file" type="file" name="backup_file"' . XHTML . '><br' . XHTML . '>' . LB;
-
+
}
$display .= '</span>' . LB
@@ -400,7 +400,7 @@
if ($file_uploads) {
if ($is_writable) {
-
+
$display .= INST_getAlertMsg($LANG_MIGRATE[12] . ini_get('upload_max_filesize') . $LANG_MIGRATE[13] . ini_get('upload_max_filesize') . $LANG_MIGRATE[14], 'notice');
} else {
@@ -562,7 +562,7 @@
} else {
if (!move_uploaded_file($backup_file['tmp_name'], $backup_dir . $backup_file['name'])) { // If able to save the uploaded file
-
+
$display .= $LANG_MIGRATE[19] . $backup_file['name'] . $LANG_MIGRATE[20] . $backup_dir . '.' . LB;
} else {
@@ -846,8 +846,8 @@
// reset cookie domain and path as wrong values may prevent login
$config->set('cookiedomain', '');
$_CONF['cookiedomain'] = '';
- $config->set('cookie_path', '/');
- $_CONF['cookie_path'] = '/';
+ $config->set('cookie_path', INST_guessCookiePath($_CONF['site_url']));
+ $_CONF['cookie_path'] = INST_guessCookiePath($_CONF['site_url']);
// check the default theme
$theme = '';
@@ -891,7 +891,7 @@
$result = DB_query("SELECT pi_name FROM {$_TABLES['plugins']} WHERE pi_enabled = 1");
$num_plugins = DB_numRows($result);
for ($i = 0; $i < $num_plugins; $i++) { // Look in the plugins directories to ensure that those plugins exist.
-
+
$plugin = DB_fetchArray($result);
if (!file_exists($_CONF['path'] . 'plugins/' . $plugin['pi_name'])) { // If plugin does not exist
@@ -958,13 +958,13 @@
}
}
-
+
// Topic images
$missing_topic_images = false;
$result = DB_query("SELECT `imageurl` FROM {$_TABLES['topics']}");
$num_topic_images = DB_numRows($result);
for ($i = 0; $i < $num_topic_images; $i++) {
-
+
$topic_image = DB_fetchArray($result);
if (!file_exists($html_path . $topic_image['imageurl'])) { // If topic image does not exist
@@ -973,9 +973,9 @@
$missing_topic_images = true;
$missing_images = true;
-
+
}
-
+
}
// Userphoto images
@@ -983,16 +983,16 @@
$result = DB_query("SELECT `photo` FROM {$_TABLES['users']} WHERE `photo` != NULL AND `photo` != ''");
$num_userphoto_images = DB_numRows($result);
for ($i = 0; $i < $num_userphoto_images; $i++) {
-
+
$userphoto_image = DB_fetchArray($result);
if (!file_exists($html_path . 'images/userphotos/' . $userphoto_image['photo'])) { // If userphoto image does not exist
-
+
// Log the error
COM_errorLog($LANG_MIGRATE[26] . $LANG_MIGRATE[29] . $userphoto_image['photo'] . $LANG_MIGRATE[30] . $_TABLES['users'] . $LANG_MIGRATE[31] . $html_path . 'images/userphotos/');
$missing_userphoto_images = true;
$missing_images = true;
-
+
}
More information about the geeklog-cvs
mailing list