From: Aaron Schulz Date: Mon, 28 Jan 2013 06:36:28 +0000 (-0800) Subject: [FileBackend] Added duplicate backend check. X-Git-Tag: 1.31.0-rc.0~20880^2 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=ab0aaa6eba7bea3895248c822ddbeb028399e7f2;p=lhc%2Fweb%2Fwiklou.git [FileBackend] Added duplicate backend check. * Not sure when this disappeared from before. Change-Id: I69a8ce06b2f3bae0e65fb65b63440eb0a2e1128c --- diff --git a/includes/filebackend/FileBackendGroup.php b/includes/filebackend/FileBackendGroup.php index 8bbc96d0de..53272045a9 100644 --- a/includes/filebackend/FileBackendGroup.php +++ b/includes/filebackend/FileBackendGroup.php @@ -122,7 +122,9 @@ class FileBackendGroup { throw new MWException( "Cannot register a backend with no name." ); } $name = $config['name']; - if ( !isset( $config['class'] ) ) { + if ( isset( $this->backends[$name] ) ) { + throw new MWException( "Backend with name `{$name}` already registered." ); + } elseif ( !isset( $config['class'] ) ) { throw new MWException( "Cannot register backend `{$name}` with no class." ); } $class = $config['class'];