HEX
Server: Apache
System: Linux cpanelx.inxs.ro 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: crowdandsafety (1041)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/cwd/wp-content/plugins/cornerstone/includes/classes/Tss/Functions/IsEmpty.php
<?php

namespace Themeco\Cornerstone\Tss\Functions;

class IsEmpty extends BuiltInFunction {

  public function run($input) {

    $val = $this->isTyped($input) ? $input->toString() : $input;

    if (is_array($val)) return empty( $val );

    if ( '' === $val ) {
      return true;
    }

    $trimmed = trim( $val );

    // empty when value starts with !
    if ( 0 === strpos( $trimmed, '!' ) ) {
      return true;
    }

    $parts = explode(' ', $trimmed );

    foreach ($parts as $i => $part) {
      $parts[$i] = preg_replace('/^0[a-zA-Z%]+|0$|none$/', '', $part);
    }

    $parts = array_filter( $parts );

    return empty($parts);

  }
}