Fix adding a domain when the page doesn't exist

It should fail on null but it should create the page if it doesn't
exist or doesn't have any content yet.
This is breaking the special page, see:
[[de:234828092#New_special_page_to_fight_spam_//_Neue_Spezialseite_zur_Spam-Bekämpfung]]

Change-Id: I9166c2bdcfacb4b19706d246fbf99b2f24ca4cc6
This commit is contained in:
Amir Sarabadani 2023-06-22 10:32:54 +02:00 committed by Ladsgroup
parent 4f65b2cb97
commit 1f7090ebac

View file

@ -206,7 +206,7 @@ class BlockedDomainStorage implements IDBAccessObject {
*/
public function addDomain( string $domain, string $notes, $user ): ?RevisionRecord {
$content = $this->loadConfigContent();
if ( !$content ) {
if ( $content === null ) {
return null;
}
$content[] = [ 'domain' => $domain, 'notes' => $notes ];