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/classes/Parsy/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/rebeccaone.com/wp-content/plugins/cornerstone/includes/classes/Parsy/OrderOperations.php
<?php

namespace Themeco\Cornerstone\Parsy;

class OrderOperations {

  const VALUE = 0;
  const OP = 1;

  protected $operatorPrecedence = [
    '*' => 1,
    '/' => 1,
    '%' => 1,
    '+' => 2,
    '-' => 2,
    '>' => 3,
    '>=' => 3,
    '<' => 3,
    '<=' => 3,
    '==' => 4,
    '===' => 4,
    '!=' => 4,
    '!==' => 4,
    'and' => 5,
    '&&' => 5,
    'xor' => 6,
    'or' => 6,
    '||' => 6,
  ];

  public function setOperatorPrecedence($ops) {
    $this->operatorPrecedence = $ops;
  }

  public function run( $input, $mapper ) {

    $stack = [];
    $postfix = $this->shuntingYard( $input );

    while( count( $postfix ) ) {
      list( $type, $next ) = array_shift($postfix);
      if ($type === self::VALUE) {
        $stack[] = $next;
        continue;
      }
      if ($type === self::OP) {
        $b = array_pop($stack);
        $a = array_pop($stack);
        $stack[] = $mapper([$a, $next, $b]);
      }
    }

    return end($stack);
  }

  // Take an input of operators and return a postfix notation version with sorted operators
  public function shuntingYard( $input ) {

    $output = [[self::VALUE,array_shift($input)]];
    $ops = [];

    try {


    while ( count( $input ) > 0 ) {
      $op = array_shift($input);
      $precedence = $this->operatorPrecedence[$op];

      while (count($ops) > 0 && $this->operatorPrecedence[end($ops)] < $this->operatorPrecedence[$op]) {
        $output[] = [self::OP,array_pop($ops)];
      }

      $ops[] = $op;
      $output[] = [self::VALUE,array_shift($input)];

    }

    while (count($ops) > 0) {
      $output[] = [self::OP,array_pop($ops)];
    }

    return $output;
  } catch (\Exception $e) {
    var_dump($e);
  }
  return [];
  }

}

Youez - 2016 - github.com/yon3zu
LinuXploit