utils/HtmlFonts.cc | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit ab371fe60568947e355d89e28d489f7f9a1a7404
Author: Jason Crain <[email protected]>
Date: Sun Jul 16 12:07:54 2017 -0500
pdftohtml: skip control characters
W3C disallows them and they cause a warning in PHP.
https://bugs.freedesktop.org/show_bug.cgi?id=101770
diff --git a/utils/HtmlFonts.cc b/utils/HtmlFonts.cc
index 49376d65..ad1fd934 100644
--- a/utils/HtmlFonts.cc
+++ b/utils/HtmlFonts.cc
@@ -26,6 +26,7 @@
// Copyright (C) 2012 Igor Slepchin <[email protected]>
// Copyright (C) 2012 Luis Parravicini <[email protected]>
// Copyright (C) 2013 Julien Nabet <[email protected]>
+// Copyright (C) 2017 Jason Crain <[email protected]>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
@@ -252,6 +253,11 @@ GooString* HtmlFont::HtmlFilter(Unicode* u, int uLen) {
}
for (int i = 0; i < uLen; ++i) {
+ // skip control characters. W3C disallows them and they cause a warning
+ // with PHP.
+ if (u[i] <= 31)
+ continue;
+
switch (u[i])
{
case '"': tmp->append("""); break;
_______________________________________________
poppler mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/poppler