Barcelona plans legal action against Madrid