Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f71b620 authored by Ronak Patel's avatar Ronak Patel
Browse files

made changes

parent 72c447b2
Loading
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -81,10 +81,14 @@ class BlackListService {
	 * @return array The array of blacklisted domains.
	 */
	public function getBlacklistedDomainData(): array {
		$foldername = self::BLACKLISTED_DOMAINS_FOLDER_NAME;
		$document = self::BLACKLISTED_DOMAINS_FILE_NAME;
		$file = $this->getBlacklistedDomainsFilePath();
		try {
			$blacklistedDomainsInJson = $this->appData->getFolder($foldername)->getFile((string) $document)->getContent();
			$blacklistedDomainsInJson = $file->getContent();
			if (empty($blacklistedDomainsInJson)) {
				return [];
			}
			return json_decode($blacklistedDomainsInJson, true);
		} catch (NotFoundException $e) {
			$this->logger->warning('Blacklisted domains file '.$document.' not found!');
			return [];
@@ -92,11 +96,6 @@ class BlackListService {
			$this->logger->warning('Blacklisted domains file '.$document.' not found!');
			return [];
		}
		if (empty($blacklistedDomainsInJson)) {
			return [];
		}
		return json_decode($blacklistedDomainsInJson, true);
		
	}
	/**
	 * Ensure the specified folder exists within AppData.