One thing that may be quicker than reading and scanning the head.php file every time the function is called would be to have the page head object set the configuration setting if it contains the XHTML doctype.
Would have to see if all the calls to the function come after the head renders... or better yet have the first call to the function set the configuration setting for the following calls.
It's what I thought first, but that might not be very practical, especially with php4: Index: src/appg/settings.php =================================================================== --- src/appg/settings.php (revision 737) +++ src/appg/settings.php (working copy) @@ -116,6 +116,7 @@ $Configuration['COMMENT_TIME_THRESHOLD'] = '60'; $Configuration['COMMENT_THRESHOLD_PUNISHMENT'] = '120'; $Configuration['UPDATE_URL'] = 'http://lussumo.com/updatecheck/default.php'; +$Configuration['XHTML_THEME'] = '1';
// Vanilla Control Positions $Configuration['CONTROL_POSITION_HEAD'] = '100'; Index: src/themes/head.php =================================================================== --- src/themes/head.php (revision 737) +++ src/themes/head.php (working copy) @@ -1,6 +1,8 @@ <?php // Note: This file is included from the library/Framework/Framework.Control.Head.php class.
+// Overwrite this setting if your theme if html based. +// $this->Context->Configuration['XHTML_THEME'] = '1'; $HeadString = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.$this->Context->GetDefinition('XMLLang').'"> <head>
I updated GetRequestUri() (Framework r167) so that it can return an unformatted url: /** * Return the request URL * * The returned URL is tainted (based on $_SERVER['QUERY_STRING']). * However, by default ($FormatUrlForDisplay == true), the url is safe for html used. * * @param boolean $FormatUrlForDisplay Set to false to return an unformatted (and tainted) URL * @return string */ function GetRequestUri($FormatUrlForDisplay='1') { global $Configuration; $Host = ForceString($_SERVER['HTTP_HOST'], ''); if ($Host != '') $Host = PrependString($Configuration['HTTP_METHOD'].'://', $Host); $Path = @$_SERVER['REQUEST_URI']; // If the path wasn't provided in the REQUEST_URI variable, let's look elsewhere for it if ($Path == '') $Path = @$_SERVER['HTTP_X_REWRITE_URL']; // Some servers use this instead // If the path still wasn't found, let's try building it with other variables if ($Path == '') { $Path = @$_SERVER['SCRIPT_NAME']; $Path .= (@$_SERVER['QUERY_STRING'] == '' ? '' : '?' . @$_SERVER['QUERY_STRING']); } $FullPath = ConcatenatePath($Host, $Path); return $FormatUrlForDisplay ? FormatStringForDisplay($FullPath) : $FullPath; }