[poppler] utils/HtmlFonts.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Jul 31 12:51:54 UTC 2017


 utils/HtmlFonts.cc |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit ab371fe60568947e355d89e28d489f7f9a1a7404
Author: Jason Crain <jason at inspiresomeone.us>
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 <igor.slepchin at gmail.com>
 // Copyright (C) 2012 Luis Parravicini <lparravi at gmail.com>
 // Copyright (C) 2013 Julien Nabet <serval2412 at yahoo.fr>
+// Copyright (C) 2017 Jason Crain <jason at inspiresomeone.us>
 //
 // 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;


More information about the poppler mailing list