Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DebugBar -> Server Error 500 #1170

Closed
fefo-p opened this issue Aug 20, 2018 · 0 comments
Closed

DebugBar -> Server Error 500 #1170

fefo-p opened this issue Aug 20, 2018 · 0 comments

Comments

@fefo-p
Copy link

fefo-p commented Aug 20, 2018

Since a few days I've been getting this error in the logs, while in the browser console a 500 error appeared whenever the DebugBar was due to appear.

CRITICAL - 2018-08-20 17:14:06 --> Use of undefined constant logs - assumed 'logs'
#0 /Library/Server/Web/Data/Sites/ci4complete/system/View/Parser.php(522) : eval()'d code(1): CodeIgniter\Debug\Exceptions->errorHandler(8, 'Use of undefine...', '/Library/Server...', 1, Array)
#1 /Library/Server/Web/Data/Sites/ci4complete/system/View/Parser.php(522): eval()
#2 /Library/Server/Web/Data/Sites/ci4complete/system/View/Parser.php(268): CodeIgniter\View\Parser->parseConditionals('<?php if (logs ...')
#3 /Library/Server/Web/Data/Sites/ci4complete/system/View/Parser.php(161): CodeIgniter\View\Parser->parse('{ if logs == []...', Array, NULL)
#4 /Library/Server/Web/Data/Sites/ci4complete/system/Debug/Toolbar/Views/toolbar.tpl.php(117): CodeIgniter\View\Parser->render('_logs.tpl.php')
#5 /Library/Server/Web/Data/Sites/ci4complete/system/Debug/Toolbar.php(285): include('/Library/Server...')
#6 /Library/Server/Web/Data/Sites/ci4complete/system/Debug/Toolbar.php(461): CodeIgniter\Debug\Toolbar::format(Array, 'html')
#7 /Library/Server/Web/Data/Sites/ci4complete/system/Events/Events.php(176): CodeIgniter\Debug\Toolbar::eventHandler()
#8 /Library/Server/Web/Data/Sites/ci4complete/system/CodeIgniter.php(201): CodeIgniter\Events\Events::trigger('pre_system')
#9 /Library/Server/Web/Data/Sites/ci4complete/public/index.php(37): CodeIgniter\CodeIgniter->run()
#10 {main}

After looking into it, I managed to correct it. It seems the if $condition`` was not escaped. So on /system/View/Parser.php```, line 510, I added double quotes like this:

$statement = $match[1] == 'elseif' ? '<?php elseif ("' . $condition . '"): ?>' : '<?php if ("' . $condition . '"): ?>';

Hope it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant