Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Remove hardcoded reference to posts table #21

@paulvanbuuren

Description

@paulvanbuuren

in od/includes/hooks-setup.php, line 69 and od/includes/utils.php, line 82 an attempt is made to select a record from table 'od_posts'. This table would not exist in standard WordPress installations, as it implies that the WP installation uses 'od_' as a table prefix. Using a fixed table prefix is bad for security and using a hardcoded table name makes the theme inflexible.

Suggested fix:
replace
$oPost = $wpdb->get_row("SELECT post_name FROM od_posts WHERE post_name = '".$sPageSlug."'");
with
$oPost = $wpdb->get_row( "SELECT post_name FROM $wpdb->posts WHERE post_name = '" . sanitize_title( $sPageSlug ) . "'" );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions