• Resolved jankdc

    (@jankdc)


    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?

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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!

    Thread Starter jankdc

    (@jankdc)

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

    Thread Starter jankdc

    (@jankdc)

    Just to let anyone know. This site was useful.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Web Validation last two errors need help democracy plugin’ is closed to new replies.