From 160bdb3553a5e4531f29f170497ae6fa24681406 Mon Sep 17 00:00:00 2001
From: Stijn Raeymaekers
Date: Thu, 24 Jan 2013 11:08:34 +0100
Subject: [PATCH 1/5] Replaced invalid operator
Caused all images and some other pages to get the following error:
syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM
---
ext/user/main.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ext/user/main.php b/ext/user/main.php
index f13ef232..b899b259 100644
--- a/ext/user/main.php
+++ b/ext/user/main.php
@@ -372,7 +372,7 @@ class UserPage extends Extension {
"INSERT INTO users (name, pass, joindate, email, class) VALUES (:username, :hash, now(), :email, :class)",
array("username"=>$event->username, "hash"=>$hash, "email"=>$email, "class"=>$class));
$uid = $database->get_last_insert_id('users_id_seq');
- $user = $user::by_name($event->username);
+ $user = $user->by_name($event->username);
log_info("user", "Created User #$uid ({$event->username})");
}
From 06832bae483b7b804044e529ab73ae3747044ece Mon Sep 17 00:00:00 2001
From: Shish
Date: Thu, 24 Jan 2013 10:52:35 +0000
Subject: [PATCH 2/5] Actually, that causes warnings in other versions; use the
static version
---
ext/user/main.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ext/user/main.php b/ext/user/main.php
index b899b259..d0ac076f 100644
--- a/ext/user/main.php
+++ b/ext/user/main.php
@@ -372,7 +372,7 @@ class UserPage extends Extension {
"INSERT INTO users (name, pass, joindate, email, class) VALUES (:username, :hash, now(), :email, :class)",
array("username"=>$event->username, "hash"=>$hash, "email"=>$email, "class"=>$class));
$uid = $database->get_last_insert_id('users_id_seq');
- $user = $user->by_name($event->username);
+ $user = User::by_name($event->username);
log_info("user", "Created User #$uid ({$event->username})");
}
From c9491ad71427112584292e9a6cef3c66c106abc7 Mon Sep 17 00:00:00 2001
From: Shish
Date: Thu, 31 Jan 2013 08:07:19 +0000
Subject: [PATCH 3/5] Get SQLite:scoreql_to_sql to return something
---
core/database.class.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/core/database.class.php b/core/database.class.php
index 0c07b248..f38af98a 100644
--- a/core/database.class.php
+++ b/core/database.class.php
@@ -147,6 +147,7 @@ class SQLite extends DBEngine {
$data = str_replace("SCORE_NOW", "\"1970-01-01\"", $data);
$data = str_replace("SCORE_STRNORM", "", $data);
$data = str_replace("SCORE_ILIKE", "LIKE", $data);
+ return $data;
}
public function create_table_sql($name, $data) {
From 6dc39fe39f44a57c7cf1f327e950334d89a2688d Mon Sep 17 00:00:00 2001
From: Shish
Date: Wed, 6 Feb 2013 08:24:01 +0000
Subject: [PATCH 4/5] show some extra help if there are no DB engines available
---
install.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/install.php b/install.php
index d6873df5..f2984e9e 100644
--- a/install.php
+++ b/install.php
@@ -197,7 +197,7 @@ function ask_questions() { // {{{
});
function update_qs() {
$(".dbconf").hide();
- var seldb = $("#database_type").val();
+ var seldb = $("#database_type").val() || "none";
$("."+seldb).show();
}
@@ -213,6 +213,10 @@ function ask_questions() { // {{{
For SQLite the database name will be a filename on disk, relative to
where shimmie was installed.
+
+ Drivers can generally be downloaded with your OS package manager;
+ for Debian / Ubuntu you want php5-pgsql, php5-mysql, or php5-sqlite.
+
EOD;
From dbfd747dd3b24be4b8c0c9c7272a2eaf5d96d4e9 Mon Sep 17 00:00:00 2001
From: Shish
Date: Wed, 6 Feb 2013 08:36:30 +0000
Subject: [PATCH 5/5] remove more slashes
---
core/util.inc.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/core/util.inc.php b/core/util.inc.php
index fbaa6c45..75e28ccd 100644
--- a/core/util.inc.php
+++ b/core/util.inc.php
@@ -757,7 +757,9 @@ function get_base_href() {
}
assert(!empty($ok_var));
$dir = dirname($ok_var);
- if($dir === "/" || $dir === "\\") $dir = "";
+ $dir = str_replace("\\", "/", $dir);
+ $dir = str_replace("//", "/", $dir);
+ $dir = rtrim($dir, "/");
return $dir;
}