From: Oliver M. B. <ol...@fa...> - 2005-01-04 10:34:56
|
> The patch below is against R_2_5_0_41 and makes this entitizing dependent > on a new constant "rss_entitize_nonascii". Please consider it for merge. Here it is --- Slash/Utility/Data/Data.pm 3 Jan 2005 09:49:01 -0000 +++ Slash/Utility/Data/Data.pm 4 Jan 2005 10:16:10 -0000 @@ -2875,6 +2875,7 @@ sub xmlencode { my($text, $nohtml) = @_; + my $constants = getCurrentStatic(); # if there is an & that is not part of an entity, convert it # to & @@ -2885,7 +2886,7 @@ $text = XML::Parser::Expat->xml_escape($text, ">"); # convert ASCII-non-printable to numeric entities - $text =~ s/([^\s\040-\176])/ "&#" . ord($1) . ";" /ge; + $text =~ s/([^\s\040-\176])/ "&#" . ord($1) . ";" /ge if $constants->{rss_entitize_nonascii}; return $text; } --- sql/mysql/defaults.sql 31 Dec 2004 12:37:19 -0000 +++ sql/mysql/defaults.sql 4 Jan 2005 10:16:16 -0000 @@ -914,6 +914,7 @@ INSERT INTO vars (name, value, description) VALUES ('returnto_passwd',CONCAT('changeme',RAND()),'Password used to sign MD5s for returnto URLs from remote sites'); INSERT INTO vars (name, value, description) VALUES ('rootdir','//www.example.com','Base URL of site; used for creating on-site links that need protocol-inspecific URL (so site can be used via HTTP and HTTPS at the same time)'); INSERT INTO vars (name, value, description) VALUES ('rss_allow_index', '0', 'Allow RSS feeds to be served from index.pl (1 = admins, 2 = subscribers, 3 = all logged-in users)'); +INSERT INTO vars (name, value, description) VALUES ('rss_entitize_nonascii', 1, 'Convert non-ASCII-printable characters into entities?'); INSERT INTO vars (name, value, description) VALUES ('rss_expire_days','7','Number of days till we blank the data from the database (the signatures still stick around though)'); INSERT INTO vars (name, value, description) VALUES ('rss_store','0','Should we be saving incomming submissions for rss'); INSERT INTO vars (name, value, description) VALUES ('run_ads','0','Should we be running ads?'); -- Oliver M. Bolzer ol...@go... GPG (PGP) Fingerprint = 621B 52F6 2AC1 36DB 8761 018F 8786 87AD EF50 D1FF |