inveniosoftware / invenio

Invenio digital library framework
https://invenio.readthedocs.io
MIT License
626 stars 292 forks source link

BibFormat: bfe_bookmark doesn't properly escape multiline JS strings. #1033

Closed lnielsen closed 10 years ago

lnielsen commented 10 years ago

Originally on 2012-05-04

The jQuery bookmark bar is not displayed in Default_HTML_detailed.bft when the abstract contains newline characters.

Example: http://openaire.cern.ch/record/847 vs http://openaire.cern.ch/record/878

The problem is caused by a JavaScript syntax error, because the string for the description is not properly escaping newline characters.

lnielsen commented 10 years ago

Originally on 2012-05-11

Fix available in javascript-str-escape-fix branch: http://invenio-software.org/repo/personal/invenio-lnielsen/log/?h=javascript-str-escape-fix

tiborsimko commented 10 years ago

Originally on 2012-06-15

This branch introduces strong dependency on json/simplejson that is not guaranteed to exist, since it is only a recommended pre-requisite. So please make use of CFG_JSON_AVAILABLE import detection and please make some ultra simple poor man's escaping option in case json is not available.

invenio-developers commented 10 years ago

Originally by Lars Holm Nielsen lars.holm.nielsen@cern.ch on 2012-06-15

In [a78633724cd6505c465eedd0bbb95ef7b119dfa3]:

#CommitTicketReference repository="" revision="a78633724cd6505c465eedd0bbb95ef7b119dfa3"
BibFormat: fixes not displaying bfe_bookmark

- String used in JavaScript to construct bookmark
  bar was not properly escaped, causing JS syntax
  errors when e.g. descriptions had line breaks.
  (closes #1033)
invenio-developers commented 10 years ago

Originally by Lars Holm Nielsen lars.holm.nielsen@cern.ch on 2012-08-09

In a78633724cd6505c465eedd0bbb95ef7b119dfa3:

#CommitTicketReference repository="" revision="a78633724cd6505c465eedd0bbb95ef7b119dfa3"
BibFormat: fixes not displaying bfe_bookmark

- String used in JavaScript to construct bookmark
  bar was not properly escaped, causing JS syntax
  errors when e.g. descriptions had line breaks.
  (closes #1033)
invenio-developers commented 10 years ago

Originally by Lars Holm Nielsen lars.holm.nielsen@cern.ch on 2012-08-09

In a78633724cd6505c465eedd0bbb95ef7b119dfa3:

#CommitTicketReference repository="" revision="a78633724cd6505c465eedd0bbb95ef7b119dfa3"
BibFormat: fixes not displaying bfe_bookmark

- String used in JavaScript to construct bookmark
  bar was not properly escaped, causing JS syntax
  errors when e.g. descriptions had line breaks.
  (closes #1033)