To hell with the neighbours !!
The original legislation protected neighbours from landlords using flats as ad hoc hotels.
Some years ago a neighbouring property owner did a deal with a tour operator who brought in coachloads of tourists from East Europe prepared to share rooms full of bunk beds. Result, endless noise of 25 or so people tramping up and down stairs, clearly audible from my bedroom. These properties were built to house between four and, perhaps, nine persons.
I failed to persuade authorities to intervene on fire safety grounds. Eventually, local authority planning enforcement officer raided the place. Hopefully, regardless of "sharing" legislation changes -- planning law governing "change of use" from (normal) residential to commercial still apply.
Also, most residential rental agreements bar subletting the whole of the property -- if you suffer from "sharing" neighbour, contact the landlord, who may then evict the offending tenant.