Support » Plugin: CM Answers » syntax error in AnswerController

  • Resolved wajrou

    (@wajrou)


    Hi,
    when I approve question (with non-auto-approve setting) in administration (CM Answer / Questions) the following error appears:

    Parse error: syntax error, unexpected ‘Question’ (T_STRING), expecting ‘,’ or ‘;’ in …\wp-content\plugins\cm-answers\lib\controllers\AnswerController.php(34) : runtime-created function on line 1

    There are double quotes in sprintf(__()) passed to string which contain php code around these calls. The first double quote closes string for echo so there is missing correct escaping of double quotes after __() call.
    Error should be solved by adding addslashes(…) or strtr(…, array(‘”‘ => ‘\”‘)) or anything similar.

    E.g.:
    add_action(‘admin_notices’, create_function(‘$q’, ‘echo “<div class=\”updated\”><p>’.__(‘Question’, ‘cm-answers’).’: ‘.addslashes(sprintf(__(‘”%s” has been succesfully approved’), $thread->getTitle())).'</p></div>”;’));

    Line 42 of AnswerController looks like containing same error.

    http://wordpress.org/extend/plugins/cm-answers/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘syntax error in AnswerController’ is closed to new replies.