From: Aaron Schulz Date: Thu, 21 Mar 2019 23:17:25 +0000 (-0700) Subject: rdbms: restrict more unsafe IDatabase methods in DBConnRef X-Git-Tag: 1.34.0-rc.0~2420^2 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=6ab57b9c2424d9cc01b29908658b273a6ce75489;p=lhc%2Fweb%2Fwiklou.git rdbms: restrict more unsafe IDatabase methods in DBConnRef Change-Id: I1933da825e6b20b4ec742e0aa39d63e9a75f9a1c --- diff --git a/includes/libs/rdbms/database/DBConnRef.php b/includes/libs/rdbms/database/DBConnRef.php index 4fdac81e66..5d80f836fc 100644 --- a/includes/libs/rdbms/database/DBConnRef.php +++ b/includes/libs/rdbms/database/DBConnRef.php @@ -74,11 +74,13 @@ class DBConnRef implements IDatabase { } public function tablePrefix( $prefix = null ) { - return $this->__call( __FUNCTION__, func_get_args() ); + // Disallow things that might confuse the LoadBalancer tracking + throw new DBUnexpectedError( $this, "Database selection is disallowed to enable reuse." ); } public function dbSchema( $schema = null ) { - return $this->__call( __FUNCTION__, func_get_args() ); + // Disallow things that might confuse the LoadBalancer tracking + throw new DBUnexpectedError( $this, "Database selection is disallowed to enable reuse." ); } public function getLBInfo( $name = null ) { @@ -86,11 +88,13 @@ class DBConnRef implements IDatabase { } public function setLBInfo( $name, $value = null ) { - return $this->__call( __FUNCTION__, func_get_args() ); + // Disallow things that might confuse the LoadBalancer tracking + throw new DBUnexpectedError( $this, "Changing LB info is disallowed to enable reuse." ); } public function setLazyMasterHandle( IDatabase $conn ) { - return $this->__call( __FUNCTION__, func_get_args() ); + // Disallow things that might confuse the LoadBalancer tracking + throw new DBUnexpectedError( $this, "Database injection is disallowed to enable reuse." ); } public function implicitGroupby() {