Browse Source

fix missing DB object when instantiated to import opml

Andrew Dolgov 5 years ago
parent
commit
1f29443530
5 changed files with 6 additions and 6 deletions
  1. 1 1
      backend.php
  2. 2 2
      classes/handler.php
  3. 1 1
      opml.php
  4. 1 1
      public.php
  5. 1 1
      update.php

+ 1 - 1
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')) {

+ 2 - 2
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;
 	}
 

+ 1 - 1
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 {

+ 1 - 1
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)) {

+ 1 - 1
update.php

@@ -308,7 +308,7 @@
 				$_REQUEST = $filter;
 				$_SESSION["uid"] = $owner_uid;
 
-				$filters = new Pref_Filters( $_REQUEST);
+				$filters = new Pref_Filters($_REQUEST);
 				$filters->add();
 			}
 		}