[ticket/12849] Fixed possible ReferenceError in core.js.

PHPBB3-12849
Merge pull request #2731 from callumacrae/ticket/12849-2

[ticket/12849] Fixed possible ReferenceError in core.js.

* callumacrae/ticket/12849-2:
  [ticket/12849] Fixed possible ReferenceError in core.js.