Skip to content

[wpmem_tos] isn't return external link. #2

@norando

Description

@norando

Thanks for WP-Members.

When [wpmem_tos url="http://yoursite.com/your-tos-page"] is set,
strpos( $atts['url'], 'http://' )
return int 0
Since int 0 is considered false by PHP, the function tos will not return $atts['url'] in this case.
It should need the === operator to test the return value of this function.

function tos( $atts, $content, $tag ) {
$url = ( strpos( $atts['url'], 'http://' ) || strpos( $atts['url'], 'https://' ) ) ? $atts['url'] : home_url( $atts['url'] );
return esc_url( $url );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions