Plugin Directory

Changeset 3064990


Ignore:
Timestamp:
04/04/2024 06:20:21 PM (2 years ago)
Author:
plnic
Message:

Avoid looking for unset params.

Location:
punchlist/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • punchlist/trunk/bootstrap.php

    r3064960 r3064990  
    135135{
    136136    if (check_ajax_referer('pl_create_project_edit_screen')) {
    137         $postId = (int) $_POST['post_ID'];
     137        $postId = isset($_POST['post_ID']) ? (int) $_POST['post_ID'] : null;
    138138        if ($postId) {
    139139            if (!in_array(get_post_status($postId), ['publish', 'future', 'draft', 'pending'])) {
     
    166166{
    167167    if (check_ajax_referer('pl_create_project_edit_screen')) {
    168         $postId = (int) $_POST['post_ID'];
     168        $postId = isset($_POST['post_ID']) ? (int) $_POST['post_ID'] : null;
    169169       
    170170        if ($postId) {
  • punchlist/trunk/src/Preview.php

    r3064960 r3064990  
    6767    public static function showPreview($query)
    6868    {
    69         $pluid = sanitize_text_field($_GET['pluid']);
    70         $postId = (int) $_GET['post_to_preview'];
     69        $pluid = isset($_GET['pluid']) ? sanitize_text_field($_GET['pluid']) : null;
     70        $postId = isset($_GET['post_to_preview']) ? (int) $_GET['post_to_preview'] : null;
    7171        if ($pluid && $postId && self::verifyPreviewCode($postId, $pluid)) {
    7272            add_filter('posts_results', [__CLASS__, 'makePostViewable'], 10, 2);
Note: See TracChangeset for help on using the changeset viewer.