Re: [30750] trunk/www/includes/common.inc
On Nov 5, 2007, at 23:18, source_changes@macosforge.org wrote:
Revision: 30750 http://trac.macosforge.org/projects/macports/changeset/30750 Author: jmpp@macports.org Date: 2007-11-05 21:18:07 -0800 (Mon, 05 Nov 2007)
Log Message: -----------
Add a long-ago-suggested-by-Ryan header() to field to includes/ common.inc to force serving of all our webpages as application/xhtml +xml documents
I did? Gosh, I'm forgetful.
(Ryan, any reason why you orginally suggested "'(...) charset=' . $encoding" rather than plain "'(...) charset=$encoding'"?)
My personal PHP code style is to avoid putting variables inside double-quoted strings. In fact I try to avoid double-quoted strings in general, favoring single-quoted strings where possible. But feel free to use whatever style gives you the most joy. :)
Modified Paths: -------------- trunk/www/includes/common.inc
Modified: trunk/www/includes/common.inc =================================================================== --- trunk/www/includes/common.inc 2007-11-06 05:11:45 UTC (rev 30749) +++ trunk/www/includes/common.inc 2007-11-06 05:18:07 UTC (rev 30750) @@ -43,6 +43,7 @@ # Page header function print_header($title, $encoding) { global $MPWEB; + header("Content-Type: application/xhtml+xml; charset=$encoding"); echo "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http:// www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
On Nov 6, 2007, at 2:58 PM, Ryan Schmidt wrote:
(Ryan, any reason why you orginally suggested "'(...) charset=' . $encoding" rather than plain "'(...) charset=$encoding'"?)
My personal PHP code style is to avoid putting variables inside double-quoted strings. In fact I try to avoid double-quoted strings in general, favoring single-quoted strings where possible. But feel free to use whatever style gives you the most joy. :)
I see. The current state of trunk/www (except for legacy/ and localized/, which we're not using) is a mixture of single and double quoted strings; if you have a chance, could you please cd into that dir and straighten the mess out? You are a much more PHP experienced programmer than I am, hands down, so I'll happily follow your advice (I did try to standardize on single quotes a while ago, but left some double ones behind where they probably don't need to exist). Regards,... -jmpp
participants (2)
-
Juan Manuel Palacios
-
Ryan Schmidt