Skip to content

Commit

Permalink
Replace use of eval() with Exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
bimimicah committed Jun 25, 2021
1 parent cfdecd8 commit 0a8bba0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions PdfToText.phpclass
Original file line number Diff line number Diff line change
Expand Up @@ -10675,7 +10675,8 @@ class PdfToTextFormDefinition // extends Object
if ( ! class_exists ( $this -> ClassName, false ) )
{
$class_def = $this -> GetClassDefinition ( ) ;
eval ( $class_def ) ;
error ( new PdfToTextException ( "Prevented eval() of an auto-generated form definition. Define the form definition class manually instead." ) ) ;
//eval ( $class_def ) ;
}

$class_name = $this -> ClassName ;
Expand Down Expand Up @@ -12253,7 +12254,8 @@ class PdfToTextCaptureApplicablePages //extends Object
private function __check_expression ( $str, $count = 1 )
{
$new_str = str_replace ( '$', $count, $str ) ;
$value = @eval ( "return ( $new_str ) ;" ) ;
error ( new PdfToTextException ( "Prevented eval() of a page number expression." ) ) ;
//$value = @eval ( "return ( $new_str ) ;" ) ;

return ( $value ) ;
}
Expand Down

0 comments on commit 0a8bba0

Please sign in to comment.