!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/uploads/script/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/   drwxr-xr-x
Free 13.11 GB of 57.97 GB (22.62%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     CSS.php (4.24 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
 * Validates the HTML attribute style, otherwise known as CSS.
 * @note We don't implement the whole CSS specification, so it might be
 *       difficult to reuse this component in the context of validating
 *       actual stylesheet declarations.
 * @note If we were really serious about validating the CSS, we would
 *       tokenize the styles and then parse the tokens. Obviously, we
 *       are not doing that. Doing that could seriously harm performance,
 *       but would make these components a lot more viable for a CSS
 *       filtering solution.
 */
class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
{

    
/**
     * @param string $css
     * @param HTMLPurifier_Config $config
     * @param HTMLPurifier_Context $context
     * @return bool|string
     */
    
public function validate($css$config$context)
    {
        
$css $this->parseCDATA($css);

        
$definition $config->getCSSDefinition();
        
$allow_duplicates $config->get("CSS.AllowDuplicates");


        
// According to the CSS2.1 spec, the places where a
        // non-delimiting semicolon can appear are in strings
        // escape sequences.   So here is some dumb hack to
        // handle quotes.
        
$len strlen($css);
        
$accum "";
        
$declarations = array();
        
$quoted false;
        for (
$i 0$i $len$i++) {
            
$c strcspn($css";'\""$i);
            
$accum .= substr($css$i$c);
            
$i += $c;
            if (
$i == $len) break;
            
$d $css[$i];
            if (
$quoted) {
                
$accum .= $d;
                if (
$d == $quoted) {
                    
$quoted false;
                }
            } else {
                if (
$d == ";") {
                    
$declarations[] = $accum;
                    
$accum "";
                } else {
                    
$accum .= $d;
                    
$quoted $d;
                }
            }
        }
        if (
$accum != ""$declarations[] = $accum;

        
$propvalues = array();
        
$new_declarations '';

        
/**
         * Name of the current CSS property being validated.
         */
        
$property false;
        
$context->register('CurrentCSSProperty'$property);

        foreach (
$declarations as $declaration) {
            if (!
$declaration) {
                continue;
            }
            if (!
strpos($declaration':')) {
                continue;
            }
            list(
$property$value) = explode(':'$declaration2);
            
$property trim($property);
            
$value trim($value);
            
$ok false;
            do {
                if (isset(
$definition->info[$property])) {
                    
$ok true;
                    break;
                }
                if (
ctype_lower($property)) {
                    break;
                }
                
$property strtolower($property);
                if (isset(
$definition->info[$property])) {
                    
$ok true;
                    break;
                }
            } while (
0);
            if (!
$ok) {
                continue;
            }
            
// inefficient call, since the validator will do this again
            
if (strtolower(trim($value)) !== 'inherit') {
                
// inherit works for everything (but only on the base property)
                
$result $definition->info[$property]->validate(
                    
$value,
                    
$config,
                    
$context
                
);
            } else {
                
$result 'inherit';
            }
            if (
$result === false) {
                continue;
            }
            if (
$allow_duplicates) {
                
$new_declarations .= "$property:$result;";
            } else {
                
$propvalues[$property] = $result;
            }
        }

        
$context->destroy('CurrentCSSProperty');

        
// procedure does not write the new CSS simultaneously, so it's
        // slightly inefficient, but it's the only way of getting rid of
        // duplicates. Perhaps config to optimize it, but not now.

        
foreach ($propvalues as $prop => $value) {
            
$new_declarations .= "$prop:$value;";
        }

        return 
$new_declarations $new_declarations false;

    }

}

// vim: et sw=4 sts=4

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0051 ]--