BERLIN—Twitter has taken legal action against a rule, coming into force in Germany from Tuesday, that obliges social media firms to block or delete criminal content quickly and report particularly serious criminal offenses to the police, a German court confirmed on Monday. The lawsuit filed at the administrative court in Cologne challenges a provision under Germany’s expanded anti-hate speech regulations that Twitter says allows user data to be passed to law enforcement before it is clear any crime has been committed. Facebook and Alphabet’s Google unit also filed similar lawsuits in the summer. “We are concerned that the law provides for a significant encroachment on citizens’ fundamental rights,” a Twitter spokesperson said. “In particular, we are concerned that the obligation to proactively share user data with law enforcement forces private companies into the role of prosecutors by reporting users to law enforcement even when there is no illegal behavior.” Germany …