WordPress.org

Forums

[resolved] Web Validation last two errors need help democracy plugin (4 posts)

  1. jankdc
    Member
    Posted 8 years ago #

    I have been validating my website and have two erros left and need help. They both have to do with democracy plugin/widget. Here is my site. And here is the validation . It says:

    Error Line 138 column 44: general entity "dem_poll_id" not defined and no default entity.

    ... <a href='/?dem_add_user_answer=true&dem_poll_id=1' rel='nofollow' onclick='r

    This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.

    and

    Error Line 138 column 55: reference to entity "dem_poll_id" for which no system identifier could be generated.

    ...?dem_add_user_answer=true&dem_poll_id=1' rel='nofollow' onclick='return dem_a

    This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.

    I have no clue where the files are. Can someone help?

  2. jalenack
    Member
    Posted 8 years ago #

    Ahh, I think I know what the problem is. The WordPress function add_query_arg() doesn't escape HTML entities (understandably).

    See line 150 of class.php (/wp-content/plugins/democracy/class.php)

    $url = add_query_arg(array('dem_add_user_answer' => 'true', 'dem_poll_id' => $this->id));

    Make that:

    $url = htmlspecialchars(add_query_arg(array('dem_add_user_answer' => 'true', 'dem_poll_id' => $this->id)));

    And you should be on your way. Cheers!

  3. jankdc
    Member
    Posted 8 years ago #

    Sweet! I don't know what I replaced but it worked. Thank You!

  4. jankdc
    Member
    Posted 8 years ago #

    Just to let anyone know. This site was useful.

Topic Closed

This topic has been closed to new replies.

About this Topic