Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Generating invalid PHP code #9

Open
bkuhl opened this issue Jun 19, 2018 · 2 comments
Open

Generating invalid PHP code #9

bkuhl opened this issue Jun 19, 2018 · 2 comments

Comments

@bkuhl
Copy link

bkuhl commented Jun 19, 2018

I'm running into the following issue when trying to get the contents for https://survivetheark.com/index.php?/forums/forum/5-changelog-patch-notes/.

   Symfony\Component\Debug\Exception\FatalThrowableError  : Parse error: syntax error, unexpected ')'

  at /Users/bkuhl/Personal/myproject/vendor/tunaabutbul/cloudflare-middleware/src/CloudflareMiddleware.php: 205
  202:             /*
  203:              * Eval PHP and get solution
  204:              */
  205:             eval($php_code);
  206:             // Split url into components.
  207:             $uri = parse_url($request->getUri());
  208:             // Add host length to get final answer.
  209:             $params['jschl_answer'] += strlen($uri['host']);

The PHP output it's generating is:

$params['jschl_answer']=);$params['jschl_answer']=+(((!0)+!(!1)+!(!1)+!(!1)+!(!1)+!(!1)+!(!1)+!(!1)+(0)).(+!(!1)).((!0)+!(!1)+!(!1)+!(!1)+!(!1)+!(!1)+!(!1)).((!0)+!(!1)+!(!1)+!(!1)+!(!1)).(+(0)).((!0)+!(!1)+!(!1)+!(!1)).((!0)+!(!1)).((!0)+!(!1)+!(!1)+!(!1)+!(!1)).((!0)+!(!1)+!(!1)));$params['jschl_answer']*=+(((!0)+!(!1)+!(!1)+!(!1)+!(!1)+!(!1)+!(!1)+!(!1)+(0)).(+!(!1)).((!0)+!(!1)+!(!1)+!(!1)+!(!1)+!(!1)+!(!1)).((!0)+!(!1)+!(!1)+!(!1)+!(!1)).(+(0)).((!0)+!(!1)+!(!1)+!(!1)).((!0)+!(!1)).((!0)+!(!1)+!(!1)+!(!1)).((!0)+!(!1)+!(!1)));
@yylzcom
Copy link

yylzcom commented Oct 7, 2018

I've got the similar error here

PHP Parse error: syntax error, unexpected ';' in .../vendor/tunaabutbul/cloudflare-middleware/src/CloudflareMiddleware.php(205) : eval()'d code on line 1

@yylzcom
Copy link

yylzcom commented Oct 7, 2018

@bkuhl
I believe that this patch fix the problem:
josiasmontag@4e196eb

I hope this can applied to the master/release as soon as possible.

matancohen365 pushed a commit that referenced this issue Oct 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants