If you apply only the torbutton patch in comment:5, then referrer spoofing is disabled. But if you apply the tor-browser.git patch as well, then spoofing works again.
It would be nice to write an automated test, but I'm not sure what the best approach is, as we need to be able to simulate an onion site or connect to a real one.
Looks good to me. This will go into 6.5a3 as well. Cherry-picked to torbutton master (commit 7f7129eb1eac515ca77d9f4b06bbf4b150fcffbe) and tor-browser-45.3.0esr-6.5-1 (commit 5837ac47afae9ca736ec4c4fedf0d83d6a601bc9).
Trac: Resolution: N/Ato fixed Status: needs_review to closed
It would be nice to write an automated test, but I'm not sure what the best approach is, as we need to be able to simulate an onion site or connect to a real one.