[wp-trac] [WordPress Trac] #5552: XMLRPC erroneously adds smart quotes to category names

WordPress Trac wp-trac at lists.automattic.com
Sun Dec 30 18:34:29 GMT 2007


#5552: XMLRPC erroneously adds smart quotes to category names
------------------------+---------------------------------------------------
 Reporter:  redsweater  |       Owner:  josephscott
     Type:  defect      |      Status:  new        
 Priority:  normal      |   Milestone:  2.5        
Component:  XML-RPC     |     Version:  2.3.2      
 Severity:  normal      |    Keywords:             
------------------------+---------------------------------------------------
 If a category contains a single-quote character ('), then its value is
 mis-reported in the response to metaWebog.getPost. The value is
 "smartened" into a right quote entity. For instance, add a category to a
 post, with the name "Won't Work" (use a single-quote, not a right-
 apostrophe, in case this content I'm typing gets smartened by Trac).

 Then, when you do a metaWeblog.getPost, or a mt.getPostCategories, you
 will find the results erroneously "smartened", even though the value of
 the category name in the database is in fact still just a single ASCII-
 compatible quote tick:

 <member><name>categories</name><value><array><data>
 <value><string>Won&amp;#8217;t Work</string></value>
 </data></array></value></member>

 This is problematic, because the name of the category reported here
 doesn't match the name of the category as reported, for instance, by
 wp.getCategories:

   <value><struct>
 <member><name>categoryId</name><value><string>17</string></value></member>
   <member><name>parentId</name><value><string>0</string></value></member>
   <member><name>description</name><value><string>Won't
 Work</string></value></member>
   <member><name>categoryName</name><value><string>Won't
 Work</string></value></member>
 <member><name>htmlUrl</name><value><string>http://192.168.1.20/wp231/?cat=17</string></value></member>
 <member><name>rssUrl</name><value><string>http://192.168.1.20/wp231?feed=rss2&amp;amp;cat=17</string></value></member>
 </struct></value>

 If some kind of "smartening" is to be done, it should be in the
 "description" field of the getCategories response. The category name as
 identified in the other fields should strictly match the categoryName
 attribute as reported by getCategories.

 This causes problems if the weblog client makes assumptions about the name
 of a category in a post matching what its name is listed as in the
 getCategories response.

 I don't think the content should be smartened except in the "description"
 field, but if you disagree I hope you'll at least consider making the
 "name" consistent across getCategories and the other XMLRPC methods.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5552>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list