diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-06 13:56:03 +0000 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-06 13:56:03 +0000 |
commit | b8ea53d2da0e987fa4123036ef8405afa955cb11 (patch) | |
tree | 060340700cb591d13bec9fae9680825884c7c542 | |
parent | 57cc740fae032cdfbea21a7074557765ec9c18ff (diff) | |
download | instadisc-b8ea53d2da0e987fa4123036ef8405afa955cb11.tar.gz instadisc-b8ea53d2da0e987fa4123036ef8405afa955cb11.tar.bz2 instadisc-b8ea53d2da0e987fa4123036ef8405afa955cb11.zip |
Central: Escape ": "s
If a colon is before a space in any value sent from the Central Server to the Client, it will be interpreted as a NAME-VALUE divider and mess up the Item. So, any wild colon-spaces have been escaped as "__INSTADISC__". Next step is to unescape them when they reach the Client.
-rw-r--r-- | central/trunk/instadisc.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/central/trunk/instadisc.php b/central/trunk/instadisc.php index 4a9d725..826a830 100644 --- a/central/trunk/instadisc.php +++ b/central/trunk/instadisc.php | |||
@@ -63,17 +63,20 @@ function instaDisc_sendItem($username, $id) | |||
63 | { | 63 | { |
64 | $verID = rand(1,65536); | 64 | $verID = rand(1,65536); |
65 | 65 | ||
66 | $title = str_replace(': ', '__INSTADISC__', $getitem3['title']); | ||
67 | |||
66 | $out = 'ID: ' . $id . "\r\n"; | 68 | $out = 'ID: ' . $id . "\r\n"; |
67 | $out .= 'Verification: ' . md5($username . ':' . $getuser3['password'] . ':' . $verID) . "\r\n"; | 69 | $out .= 'Verification: ' . md5($username . ':' . $getuser3['password'] . ':' . $verID) . "\r\n"; |
68 | $out .= 'Verification-ID: ' . $verID . "\r\n"; | 70 | $out .= 'Verification-ID: ' . $verID . "\r\n"; |
69 | $out .= 'Subscription: ' . $getitem3['subscription'] . "\r\n"; | 71 | $out .= 'Subscription: ' . $getitem3['subscription'] . "\r\n"; |
70 | $out .= 'Title: ' . $getitem3['title'] . "\r\n"; | 72 | $out .= 'Title: ' . $title . "\r\n"; |
71 | $out .= 'Author: ' . $getitem3['author'] . "\r\n"; | 73 | $out .= 'Author: ' . $getitem3['author'] . "\r\n"; |
72 | $out .= 'URL: ' . $getitem3['url'] . "\r\n"; | 74 | $out .= 'URL: ' . $getitem3['url'] . "\r\n"; |
73 | 75 | ||
74 | $semantics = unserialize($getitem3['semantics']); | 76 | $semantics = unserialize($getitem3['semantics']); |
75 | foreach ($semantics as $name => $value) | 77 | foreach ($semantics as $name => $value) |
76 | { | 78 | { |
79 | $value = str_replace(': ', '__INSTADISC__', $value); | ||
77 | $out .= $name . ': ' . $value . "\r\n"; | 80 | $out .= $name . ': ' . $value . "\r\n"; |
78 | } | 81 | } |
79 | 82 | ||