Ejemplo n.º 1
0
 public static function getCompleteUrl($uri, $protocol = null)
 {
     if ($protocol === null) {
         $protocol = Config::get()->standardProtocolForAbsoluteUrls;
     }
     $url = $uri;
     // Nur wenn Protokoll nicht angegeben ist...
     if (UTF8String::strpos($url, '://') === false) {
         // ggf. Server-Namen erg�nzen
         if (UTF8String::substr($url, 0, 1) == '/') {
             if ($_SERVER['HTTP_HOST'] !== '') {
                 $url = self::htmlEntities($_SERVER['HTTP_HOST']) . $url;
             } else {
                 $url = self::htmlEntities($_SERVER['SERVER_NAME']) . $url;
             }
         }
         // Protokoll erg�nzen
         $url = $protocol . $url;
     }
     return $url;
 }
Ejemplo n.º 2
0
 protected function doesFieldValueContainSearchString($field_value, $search_array)
 {
     // $search_array wird als Array aus UTF8 codierten, in Kleinbuchstaben umgewandelten Strings erwartet
     // $field_value dagegen kann ein UTF8 codierter String oder ein beliebig tief verschachteltes Array sein
     if (is_array($field_value)) {
         foreach ($field_value as $field_value_item) {
             if ($this->doesFieldValueContainSearchString($field_value_item, $search_array)) {
                 return true;
             }
         }
     } else {
         $unencoded_field_value = UTF8String::strtolower(trim($field_value));
         // Möglicherweise sind Teile des Strings als HTML-Entities codiert
         $html_decoded_field_value = html_entity_decode($unencoded_field_value, ENT_QUOTES | ENT_HTML5, 'UTF-8');
         foreach ($search_array as $search_item) {
             if (UTF8String::strpos($unencoded_field_value, $search_item) !== false) {
                 return true;
             }
             if (UTF8String::strpos($html_decoded_field_value, $search_item) !== false) {
                 return true;
             }
         }
     }
     return false;
 }
/**
 * Simple function to demonstrate how to control file access using "accessControl" callback.
 * This method will disable accessing files/folders starting from  '.' (dot)
 *
 * @param  UTF8String $attr attribute name (read|write|locked|hidden)
 * @param  UTF8String $path file path relative to volume root directory started with directory separator
 *
 * @return bool|null
 **/
function access($attr, $path, $data, $volume)
{
    return UTF8String::strpos(basename($path), '.') === 0 ? !($attr == 'read' || $attr == 'write') : null;
    // else elFinder decide it itself
}