From 1f294435307ef6cbbf3f35a22af9bf92131338ed Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 18 Apr 2013 23:19:14 +0400 Subject: [PATCH] fix missing DB object when instantiated to import opml --- backend.php | 2 +- classes/handler.php | 4 ++-- opml.php | 2 +- public.php | 2 +- update.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend.php b/backend.php index c69d6d98..84abc973 100644 --- a/backend.php +++ b/backend.php @@ -120,7 +120,7 @@ if ($override) { $handler = $override; } else { - $handler = new $op(Db::get(), $_REQUEST); + $handler = new $op($_REQUEST); } if ($handler && implements_interface($handler, 'IHandler')) { diff --git a/classes/handler.php b/classes/handler.php index d8e2a302..b2093204 100644 --- a/classes/handler.php +++ b/classes/handler.php @@ -3,8 +3,8 @@ class Handler implements IHandler { protected $dbh; protected $args; - function __construct($dbh, $args) { - $this->dbh = $dbh; + function __construct($args) { + $this->dbh = Db::get(); $this->args = $args; } diff --git a/opml.php b/opml.php index b9322161..af369405 100644 --- a/opml.php +++ b/opml.php @@ -24,7 +24,7 @@ if (db_num_rows($result) == 1) { $owner_uid = db_fetch_result($result, 0, "owner_uid"); - $opml = new Opml( $_REQUEST); + $opml = new Opml($_REQUEST); $opml->opml_export("", $owner_uid, true, false); } else { diff --git a/public.php b/public.php index f92d252e..33f5af75 100644 --- a/public.php +++ b/public.php @@ -42,7 +42,7 @@ if ($override) { $handler = $override; } else { - $handler = new Handler_Public(Db::get(), $_REQUEST); + $handler = new Handler_Public($_REQUEST); } if (implements_interface($handler, "IHandler") && $handler->before($method)) { diff --git a/update.php b/update.php index d8ea5236..c301083f 100755 --- a/update.php +++ b/update.php @@ -308,7 +308,7 @@ $_REQUEST = $filter; $_SESSION["uid"] = $owner_uid; - $filters = new Pref_Filters( $_REQUEST); + $filters = new Pref_Filters($_REQUEST); $filters->add(); } } -- 2.39.2