Page MenuHomePhabricator

Missing chomp control for YAML literals
Closed, ResolvedPublic

Description

Author: bjoern

Description:
The API output for the cited URL goes like this:

query:

general:
  mainpage: |
    Wikipedia:Hauptseite
  base: |
    http://de.wikipedia.org/wiki/Wikipedia:Hauptseite
  sitename: Wikipedia
  generator: MediaWiki 1.16alpha-wmf
  phpversion: 5.2.4-2ubuntu5.7wm1
  phpsapi: apache2handler
  dbtype: mysql
  dbversion: 5.1.33-log
  rev: 59858
  case: first-letter
  rights: >
    Creative Commons Attribution-Share Alike
    3.0 Unported
  lang: de

For the "base" and "rights" properties (and others like it) this causes the trailing new line to be included in the property value (so you get "http://de.wikipedia.org/wiki/Wikipedia:Hauptseite\n"). This should instead use the "strip" chomp control ("-"), like so:

query:

general:
  mainpage: |-
    Wikipedia:Hauptseite
  base: |-
    http://de.wikipedia.org/wiki/Wikipedia:Hauptseite
  sitename: Wikipedia
  generator: MediaWiki 1.16alpha-wmf
  phpversion: 5.2.4-2ubuntu5.7wm1
  phpsapi: apache2handler
  dbtype: mysql
  dbversion: 5.1.33-log
  rev: 59858
  case: first-letter
  rights: >-
    Creative Commons Attribution-Share Alike
    3.0 Unported
  lang: de

See http://yaml.org/spec/1.0/#c-chomp-control for details.


Version: unspecified
Severity: normal
URL: http://de.wikipedia.org/w/api.php?action=query&meta=siteinfo&format=yamlfm

Details

Reference
bz21945

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:47 PM
bzimport added a project: MediaWiki-API.
bzimport set Reference to bz21945.

Fixed in r60367.