Don't add #undefined as redirectHash

wgInternalRedirect contains the complete internal redirect, not only
the hash, which results into undefined, if there is no hash. Check for
this, before add the hash to toggle the section.

Follow up: I88f847b488d57c3c3f4dab6bac6cd41a371640de

Bug: 71573
Change-Id: Ie96f0a2a3315b619947b88b26042a09fa3e104ad