MDL-35146 mod_wiki: fixed variable typo and altered code to conform to Moodle guidelines