Exemplo n.º 1
0
 public function __construct()
 {
     $this->options = get_option('fileaway_options');
     self::$pathinfo = isset($this->options['pathinfo']) && $this->options['pathinfo'] == 'enabled' ? true : false;
     self::$s2member = fileaway_utility::active('s2member/s2member.php');
     $this->pathoptions = array();
     $this->paths();
     $this->imagetypes = array('bmp', 'jpg', 'jpeg', 'gif', 'png', 'tif', 'tiff');
     $this->codexts = array('js', 'pl', 'py', 'rb', 'css', 'less', 'scss', 'sass', 'php', 'htm', 'html', 'cgi', 'asp', 'cfm', 'cpp', 'xml', 'yml', 'shtm', 'xhtm', 'java', 'class');
     $this->nevershows = array('index.htm', 'index.html', 'index.php', '.htaccess', '.htpasswd', '_fa.feed.id.ini');
     $this->file_exclusions = $this->options['exclusions'] ? preg_split('/(, |,)/', trim($this->options['exclusions']), -1, PREG_SPLIT_NO_EMPTY) : array();
     $this->dir_exclusions = $this->options['direxclusions'] ? preg_split('/(, |,)/', trim($this->options['direxclusions']), -1, PREG_SPLIT_NO_EMPTY) : array();
     $image = $GLOBALS['is_safari'] ? 'b' : '1';
     $this->filegroups = array('adobe' => array('Adobe', '!', array('abf', 'aep', 'afm', 'ai', 'as', 'eps', 'fla', 'flv', 'fm', 'indd', 'pdd', 'pdf', 'pmd', 'ppj', 'prc', 'ps', 'psb', 'psd', 'swf')), 'application' => array('Application', 'T', array('bat', 'dll', 'exe', 'msi')), 'audio' => array('Audio', 'C', array('aac', 'aif', 'aifc', 'aiff', 'amr', 'ape', 'au', 'bwf', 'flac', 'iff', 'gsm', 'la', 'm4a', 'm4b', 'm4p', 'mid', 'mp2', 'mp3', 'mpc', 'ogg', 'ots', 'ram', 'raw', 'rex', 'rx2', 'spx', 'swa', 'tta', 'vox', 'wav', 'wma', 'wv')), 'compression' => array('Compression', ''', array('7z', 'a', 'ace', 'afa', 'ar', 'bz2', 'cab', 'cfs', 'cpio', 'cpt', 'dar', 'dd', 'dmg', 'gz', 'lz', 'lzma', 'lzo', 'mar', 'rar', 'rz', 's7z', 'sda', 'sfark', 'shar', 'tar', 'tgz', 'xz', 'z', 'zip', 'zipx', 'zz')), 'css' => array('CSS', '(', array('css', 'less', 'sass', 'scss')), 'image' => array('Image', $image, array('bmp', 'dds', 'exif', 'gif', 'hdp', 'hdr', 'iff', 'jfif', 'jpeg', 'jpg', 'jxr', 'pam', 'pbm', 'pfm', 'pgm', 'png', 'pnm', 'ppm', 'raw', 'rgbe', 'tga', 'thm', 'tif', 'tiff', 'webp', 'wdp', 'yuv')), 'msdoc' => array('MS Doc', '#', array('doc', 'docm', 'docx', 'dot', 'dotx')), 'msexcel' => array('MS Excel', '$', array('xls', 'xlsm', 'xlsb', 'xlsx', 'xlt', 'xltm', 'xltx', 'xlw')), 'openoffice' => array('Open Office', '"', array('dbf', 'dbf4', 'odp', 'ods', 'odt', 'stc', 'sti', 'stw', 'sxc', 'sxi', 'sxw')), 'powerpoint' => array('PowerPoint', '&', array('pot', 'potm', 'potx', 'pps', 'ppt', 'pptm', 'pptx', 'pub')), 'script' => array('Script', '%', array('asp', 'cfm', 'cgi', 'clas', 'class', 'cpp', 'htm', 'html', 'java', 'js', 'php', 'pl', 'py', 'rb', 'shtm', 'shtml', 'xhtm', 'xhtml', 'xml', 'yml')), 'text' => array('Text', '.', array('123', 'csv', 'log', 'psw', 'rtf', 'sql', 'txt', 'uof', 'uot', 'wk1', 'wks', 'wpd', 'wps')), 'video' => array('Video', 'W', array('avi', 'divx', 'mov', 'm4p', 'm4v', 'mkv', 'mp4', 'mpeg', 'mpg', 'ogv', 'qt', 'rm', 'rmvb', 'vob', 'webm', 'wmv')), 'unknown' => array('Unknown', ')', false));
     $agent = $_SERVER['HTTP_USER_AGENT'];
     $this->is_opera = stripos($agent, 'opr') !== false || stripos($agent, 'opera') !== false ? true : false;
     $mobiles = array('mobile', 'iphone', 'ipod', 'ipad', 'android', 'tablet', 'wOSBrowser', 'TouchPad', 'Nook', 'Pad', 'blackberry', 'opera mobi', 'opera mini', 'Skyfire', 'Samsung', 'webOS', 'LG', 'Kindle', 'Silk', 'WindowsMobile', 'IEMobile', 'blazer', 'BOLT', 'Series60', 'Symbian', 'Nokia', 'Droid', 'XT720', 'MOT-', 'MIB', 'WM5', 'teleca q7', 'TeaShark', 'SEMC-Browser', 'NetFront', 'Minimo', 'MIB', 'Maemo Browser', 'Iris', 'GoBrowser', 'Fennec', 'Dorothy', 'Doris', 'uzardweb', 'SPH', 'SCH');
     $this->is_mobile = false;
     foreach ($mobiles as $mobile) {
         if (stripos($agent, $mobile) !== false) {
             $this->is_mobile = true;
             break;
         }
     }
 }