Legislation designed to combat global copyright infringement has been referred to the European Court of Justice to check whether it complies with EU fundamental rights.