Skip to content

Commit

Permalink
Fix \f crush
Browse files Browse the repository at this point in the history
Escaped f (\f) in text crushes parcing process;
The better way is using base php function *stripcslashes*
  • Loading branch information
machekhin authored Jan 11, 2020
1 parent 0c85b15 commit 4f4fd10
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Smalot/PdfParser/Font.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,7 @@ public function decodeText($commands)
}

// replace escaped chars
$text = str_replace(
array('\\\\', '\(', '\)', '\n', '\r', '\t', '\ '),
array('\\', '(', ')', "\n", "\r", "\t", ' '),
$text
);
$text = stripcslashes($text);

// add content to result string
if (isset($words[$word_position])) {
Expand Down

0 comments on commit 4f4fd10

Please sign in to comment.