Fix: Warning when adding custom top navigation item

Fixed a PHP warning in some environment when adding a custom item to the
top navigation bar. A non well-formed regex expression caused this
warning.