Contains blacklisted word

@param  array  $list
@param  string $content
@return bool
167579
protected function containsBlacklistedWord(array $list, string $content) : bool
    {
        if (!$this->isCaseSensitive) {
            $content = strtolower($content);
            $list    = array_map('strtolower', $list);
        }
        foreach ($list as $term) {
            if (strpos($content, $term) !== false) {
                $this->hint .= PHP_EOL . 'Invalid use of \'' . $term . '\'';
                return true;
            }
        }
        return false;
    }
176007
public function setBlackList(array $list)
    {
        $list = array_unique(array_filter(array_map('trim', array_values($list))));
        sort($list);
        if ($this->blackList !== $list) {
            $this->clear();
            $this->blackList = $list;
        }
        return $this;
    }
1186340
private static function isValid(string $content): bool
    {
        if ('' === $content) {
            return false;
        }

        return (bool)preg_match_all(static::getPlaceholderPattern(), $content);
    }
947747
def blacklisted?(page)
      return false if whitelisted?(page)
      FILENAME_BLACKLIST.include?(page.basename.upcase)
    end
13362
protected function _censor($content) {
        $pattern = implode('|', array_map(array($this, '_prepareRegex'), $this->getBlacklist()));
        $content = preg_replace_callback('/(?:^|\b)(?:' . $pattern . ')(?:\b|$)/is', array($this, '_censorCallback'), $content);

        return $content;
    }
882021
protected function filterList($list, $perm)
    {
        $ret = $list->filterByCallback(function ($item) use ($perm) {
            if ($item->hasExtension('Restrictable')) {
                return $item->checkPerm($perm);
            }
            return $item->canView();
        });
        return $ret;
    }
278162
public function verifyListIsEmpty(): void
    {
        $firstRowValue = $this->adminLists['Content items']->table->getCellValue(1, 1);

        if (
        !($this->adminLists['Content items']->table->getItemCount() === 1 &&
            strpos($firstRowValue, 'No content items.') !== false)
        ) {
            throw new \Exception('"Content items" list is not empty.');
        }
    }
1232563
protected function checkEntry( array $list )
	{
		if( $this->getValue( $list, 'attribute.code' ) === null ) {
			return false;
		}

		if( ( $type = $this->getValue( $list, 'product.lists.type' ) ) && !isset( $this->listTypes[$type] ) )
		{
			$msg = sprintf( 'Invalid type "%1$s" (%2$s)', $type, 'product list' );
			throw new \Aimeos\Controller\Common\Exception( $msg );
		}

		if( ( $type = $this->getValue( $list, 'attribute.type' ) ) && !isset( $this->types[$type] ) )
		{
			$msg = sprintf( 'Invalid type "%1$s" (%2$s)', $type, 'attribute' );
			throw new \Aimeos\Controller\Common\Exception( $msg );
		}

		return true;
	}
310219
private boolean containsRestrictedPrefix(String tpl)
	{
		for (String i : blackPrefixList) {
			if (tpl.startsWith(i))
				return true;
		}
		return false;
	}
69496
public static function isConsistent($listElement, array $list = [])
    {
        // empty list
        if (!count($list)) {
            return true;
        }

        $listElement = self::getBodyOfListElement($listElement);

        // list element is a string
        if (is_string($listElement)) {
            return true;
        }

        // list element is an array or an object
        if (is_array($listElement) || is_object($listElement)) {
            if (count(array_diff_key(
                (array) $listElement,
                (array) self::getBodyOfFirstElementOfList($list)
            ))) {
                return false;
            }
        }

        return true;
    }
1202110
def assert_not_contain(content)
      hc = HasContent.new(content)
      assert !hc.matches?(current_dom), hc.negative_failure_message
    end
28073
public static function isList($array)
    {
        if (!is_array($array)) {
            return false;
        }

      // TODO: generally incorrect, but it's correct given Payjp's response
        foreach (array_keys($array) as $k) {
            if (!is_numeric($k)) {
                return false;
            }
        }
        return true;
    }
883638
function contains($item, callable $callback = null) {
        if ($callback === null) {
            $callback = __NAMESPACE__ . '\\compare';
        }
        foreach ($this->avl as $pair) {
            /**
             * @var Pair $pair
             */
            if (call_user_func($callback, $pair->second, $item) === 0) {
                return true;
            }
        }

        return false;
    }
250132
public function isAllowed($what, $content = null)
    {
        $contenttype = null;
        $contentid = null;
        if ($content instanceof \Bolt\Legacy\Content) {
            // It's a Legacy content record
            $contenttype = $content;
            $contentid = $content['id'];
        } elseif ($content instanceof \Bolt\Storage\Mapping\ContentType) {
            // It's non-legacy content record.
            $contenttype = (string) $content;
        } elseif (is_array($content)) {
            // It's a contenttype
            $contenttype = $content;
        } elseif (is_string($content)) {
            $contenttype = $content;
        }

        return $this->users->isAllowed($what, $contenttype, $contentid);
    }
286446
public static void checkQuery(SpiQuery<?> query, Set<String> whitelist,
                                  Set<String> blacklist, boolean ignoreUnknown) {
        checkQuery(
                query,
                new ListExpressionValidation(
                        query.getBeanDescriptor(), whitelist, blacklist
                ),
                ignoreUnknown
        );
    }
725882
protected function isBlacklisted($uri, $referer, array $blacklistUrls)
    {
        foreach ($blacklistUrls as $blacklistUrl) {
            $pattern = '`' . $blacklistUrl . '`i';
            $match   = preg_match($pattern, $uri) + preg_match($pattern, $referer);

            if ($match > 0) {
                return true;
            }
        }

        return false;
    }
1358447
public function checkIn($value, $list)
    {
        // List is passed as second parameter or with many single parameters
        $args = func_get_args();
        array_shift($args); // remove $value

        $items = count($args) > 1 ? $args : (array)$list;

        return in_array($value, $items);
    }