Home > concrete5 for developers > Making concrete5 closer to w3c standards

Making concrete5 closer to w3c standards

I recommend to apply the following fix in concrete5 to make the result xhtml code be more w3c compliant. As you should know, all ampersands (&) should be replaced with its html representation in hrefs, js sources, image sources, etc.:

&

By default concrete5 might generate a line calling javascript file with unescaped ampersands. It looks like

Let’s fix it.

Open ‘/concrete/elements/header_required.php’.

Find the following line (line 101 in concrete 5.3.0):

$this->addHeaderItem('<script type="text/javascript" src="' . REL_DIR_FILES_TOOLS_REQUIRED . '/page_controls_menu_js?cID=' . $c->getCollectionID() . '&cvID=' . $cvID . '&btask=' . $_REQUEST['btask'] . '&ts=' . time() . '"></script>', 'CORE');

And replace & with &amp;, like this:

$this->addHeaderItem('<script type="text/javascript" src="' . REL_DIR_FILES_TOOLS_REQUIRED . '/page_controls_menu_js?cID=' . $c->getCollectionID() . '&amp;cvID=' . $cvID . '&amp;btask=' . $_REQUEST['btask'] . '&amp;ts=' . time() . '"></script>', 'CORE');

This will make your code something better!

Categories: concrete5 for developers Tags:
  1. No comments yet.
  1. No trackbacks yet.