WordPress.org

Ready to get started?Download WordPress

Forums

Social Sharing Toolkit
Bugfix: Open Graph excerpt needs htmlspecialchars() (1 post)

  1. BramNL
    Member
    Posted 1 year ago #

    Starting at line 513, the excerpt might break HTML if a read more link is included. This might result in, for example:

    <meta property="og:description" content="Lorem ipsum, etc… <a href="http://example.com/">read more <span class="meta-nav">→</span></a>"/>

    As you can see, this is not valid HTML.

    Fix: add htmlspecialchars():

    if ($excerpt != '') {
    				echo '
    		<meta property="og:description" content="'.htmlspecialchars($excerpt).'"/>';

    Possibly there are more vars that needs sanitizing.

    http://wordpress.org/extend/plugins/social-sharing-toolkit/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.