Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
PK!,q%q%captcha_helper.phpnu[ '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_path' => '', 'expiration' => 7200, 'word_length' => 8, 'font_size' => 16, 'img_id' => '', 'pool' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'colors' => array( 'background' => array(255,255,255), 'border' => array(153,102,102), 'text' => array(204,153,153), 'grid' => array(255,182,182) ) ); foreach ($defaults as $key => $val) { if ( ! is_array($data) && empty($$key)) { $$key = $val; } else { $$key = isset($data[$key]) ? $data[$key] : $val; } } if ($img_path === '' OR $img_url === '' OR ! is_dir($img_path) OR ! is_really_writable($img_path) OR ! extension_loaded('gd')) { return FALSE; } // ----------------------------------- // Remove old images // ----------------------------------- $now = microtime(TRUE); $current_dir = @opendir($img_path); while ($filename = @readdir($current_dir)) { if (in_array(substr($filename, -4), array('.jpg', '.png')) && (str_replace(array('.jpg', '.png'), '', $filename) + $expiration) < $now) { @unlink($img_path.$filename); } } @closedir($current_dir); // ----------------------------------- // Do we have a "word" yet? // ----------------------------------- if (empty($word)) { $word = ''; $pool_length = strlen($pool); $rand_max = $pool_length - 1; // PHP7 or a suitable polyfill if (function_exists('random_int')) { try { for ($i = 0; $i < $word_length; $i++) { $word .= $pool[random_int(0, $rand_max)]; } } catch (Exception $e) { // This means fallback to the next possible // alternative to random_int() $word = ''; } } } if (empty($word)) { // Nobody will have a larger character pool than // 256 characters, but let's handle it just in case ... // // No, I do not care that the fallback to mt_rand() can // handle it; if you trigger this, you're very obviously // trying to break it. -- Narf if ($pool_length > 256) { return FALSE; } // We'll try using the operating system's PRNG first, // which we can access through CI_Security::get_random_bytes() $security = get_instance()->security; // To avoid numerous get_random_bytes() calls, we'll // just try fetching as much bytes as we need at once. if (($bytes = $security->get_random_bytes($pool_length)) !== FALSE) { $byte_index = $word_index = 0; while ($word_index < $word_length) { // Do we have more random data to use? // It could be exhausted by previous iterations // ignoring bytes higher than $rand_max. if ($byte_index === $pool_length) { // No failures should be possible if the // first get_random_bytes() call didn't // return FALSE, but still ... for ($i = 0; $i < 5; $i++) { if (($bytes = $security->get_random_bytes($pool_length)) === FALSE) { continue; } $byte_index = 0; break; } if ($bytes === FALSE) { // Sadly, this means fallback to mt_rand() $word = ''; break; } } list(, $rand_index) = unpack('C', $bytes[$byte_index++]); if ($rand_index > $rand_max) { continue; } $word .= $pool[$rand_index]; $word_index++; } } } if (empty($word)) { for ($i = 0; $i < $word_length; $i++) { $word .= $pool[mt_rand(0, $rand_max)]; } } elseif ( ! is_string($word)) { $word = (string) $word; } // ----------------------------------- // Determine angle and position // ----------------------------------- $length = strlen($word); $angle = ($length >= 6) ? mt_rand(-($length-6), ($length-6)) : 0; $x_axis = mt_rand(6, (360/$length)-16); $y_axis = ($angle >= 0) ? mt_rand($img_height, $img_width) : mt_rand(6, $img_height); // Create image // PHP.net recommends imagecreatetruecolor(), but it isn't always available $im = function_exists('imagecreatetruecolor') ? imagecreatetruecolor($img_width, $img_height) : imagecreate($img_width, $img_height); // ----------------------------------- // Assign colors // ---------------------------------- is_array($colors) OR $colors = $defaults['colors']; foreach (array_keys($defaults['colors']) as $key) { // Check for a possible missing value is_array($colors[$key]) OR $colors[$key] = $defaults['colors'][$key]; $colors[$key] = imagecolorallocate($im, $colors[$key][0], $colors[$key][1], $colors[$key][2]); } // Create the rectangle ImageFilledRectangle($im, 0, 0, $img_width, $img_height, $colors['background']); // ----------------------------------- // Create the spiral pattern // ----------------------------------- $theta = 1; $thetac = 7; $radius = 16; $circles = 20; $points = 32; for ($i = 0, $cp = ($circles * $points) - 1; $i < $cp; $i++) { $theta += $thetac; $rad = $radius * ($i / $points); $x = ($rad * cos($theta)) + $x_axis; $y = ($rad * sin($theta)) + $y_axis; $theta += $thetac; $rad1 = $radius * (($i + 1) / $points); $x1 = ($rad1 * cos($theta)) + $x_axis; $y1 = ($rad1 * sin($theta)) + $y_axis; imageline($im, $x, $y, $x1, $y1, $colors['grid']); $theta -= $thetac; } // ----------------------------------- // Write the text // ----------------------------------- $use_font = ($font_path !== '' && file_exists($font_path) && function_exists('imagettftext')); if ($use_font === FALSE) { ($font_size > 5) && $font_size = 5; $x = mt_rand(0, $img_width / ($length / 3)); $y = 0; } else { ($font_size > 30) && $font_size = 30; $x = mt_rand(0, $img_width / ($length / 1.5)); $y = $font_size + 2; } for ($i = 0; $i < $length; $i++) { if ($use_font === FALSE) { $y = mt_rand(0 , $img_height / 2); imagestring($im, $font_size, $x, $y, $word[$i], $colors['text']); $x += ($font_size * 2); } else { $y = mt_rand($img_height / 2, $img_height - 3); imagettftext($im, $font_size, $angle, $x, $y, $colors['text'], $font_path, $word[$i]); $x += $font_size; } } // Create the border imagerectangle($im, 0, 0, $img_width - 1, $img_height - 1, $colors['border']); // ----------------------------------- // Generate the image // ----------------------------------- $img_url = rtrim($img_url, '/').'/'; if (function_exists('imagejpeg')) { $img_filename = $now.'.jpg'; imagejpeg($im, $img_path.$img_filename); } elseif (function_exists('imagepng')) { $img_filename = $now.'.png'; imagepng($im, $img_path.$img_filename); } else { return FALSE; } $img = ' '; ImageDestroy($im); return array('word' => $word, 'time' => $now, 'image' => $img, 'filename' => $img_filename); } } PK!ڌ%%html_helper.phpnu['.$data.''; } } // ------------------------------------------------------------------------ if ( ! function_exists('ul')) { /** * Unordered List * * Generates an HTML unordered list from an single or multi-dimensional array. * * @param array * @param mixed * @return string */ function ul($list, $attributes = '') { return _list('ul', $list, $attributes); } } // ------------------------------------------------------------------------ if ( ! function_exists('ol')) { /** * Ordered List * * Generates an HTML ordered list from an single or multi-dimensional array. * * @param array * @param mixed * @return string */ function ol($list, $attributes = '') { return _list('ol', $list, $attributes); } } // ------------------------------------------------------------------------ if ( ! function_exists('_list')) { /** * Generates the list * * Generates an HTML ordered list from an single or multi-dimensional array. * * @param string * @param mixed * @param mixed * @param int * @return string */ function _list($type = 'ul', $list = array(), $attributes = '', $depth = 0) { // If an array wasn't submitted there's nothing to do... if ( ! is_array($list)) { return $list; } // Set the indentation based on the depth $out = str_repeat(' ', $depth) // Write the opening list tag .'<'.$type._stringify_attributes($attributes).">\n"; // Cycle through the list elements. If an array is // encountered we will recursively call _list() static $_last_list_item = ''; foreach ($list as $key => $val) { $_last_list_item = $key; $out .= str_repeat(' ', $depth + 2).'
  • '; if ( ! is_array($val)) { $out .= $val; } else { $out .= $_last_list_item."\n"._list($type, $val, '', $depth + 4).str_repeat(' ', $depth + 2); } $out .= "
  • \n"; } // Set the indentation for the closing tag and apply it return $out.str_repeat(' ', $depth).'\n"; } } // ------------------------------------------------------------------------ if ( ! function_exists('img')) { /** * Image * * Generates an element * * @param mixed * @param bool * @param mixed * @return string */ function img($src = '', $index_page = FALSE, $attributes = '') { if ( ! is_array($src) ) { $src = array('src' => $src); } // If there is no alt attribute defined, set it to an empty string if ( ! isset($src['alt'])) { $src['alt'] = ''; } $img = ' $v) { if ($k === 'src' && ! preg_match('#^(data:[a-z,;])|(([a-z]+:)?(?config->site_url($v).'"'; } else { $img .= ' src="'.get_instance()->config->slash_item('base_url').$v.'"'; } } else { $img .= ' '.$k.'="'.$v.'"'; } } return $img._stringify_attributes($attributes).' />'; } } // ------------------------------------------------------------------------ if ( ! function_exists('doctype')) { /** * Doctype * * Generates a page document type declaration * * Examples of valid options: html5, xhtml-11, xhtml-strict, xhtml-trans, * xhtml-frame, html4-strict, html4-trans, and html4-frame. * All values are saved in the doctypes config file. * * @param string type The doctype to be generated * @return string */ function doctype($type = 'xhtml1-strict') { static $doctypes; if ( ! is_array($doctypes)) { if (file_exists(APPPATH.'config/doctypes.php')) { include(APPPATH.'config/doctypes.php'); } if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php')) { include(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php'); } if (empty($_doctypes) OR ! is_array($_doctypes)) { $doctypes = array(); return FALSE; } $doctypes = $_doctypes; } return isset($doctypes[$type]) ? $doctypes[$type] : FALSE; } } // ------------------------------------------------------------------------ if ( ! function_exists('link_tag')) { /** * Link * * Generates link to a CSS file * * @param mixed stylesheet hrefs or an array * @param string rel * @param string type * @param string title * @param string media * @param bool should index_page be added to the css path * @return string */ function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE) { $CI =& get_instance(); $link = ' $v) { if ($k === 'href' && ! preg_match('#^([a-z]+:)?//#i', $v)) { if ($index_page === TRUE) { $link .= 'href="'.$CI->config->site_url($v).'" '; } else { $link .= 'href="'.$CI->config->slash_item('base_url').$v.'" '; } } else { $link .= $k.'="'.$v.'" '; } } } else { if (preg_match('#^([a-z]+:)?//#i', $href)) { $link .= 'href="'.$href.'" '; } elseif ($index_page === TRUE) { $link .= 'href="'.$CI->config->site_url($href).'" '; } else { $link .= 'href="'.$CI->config->slash_item('base_url').$href.'" '; } $link .= 'rel="'.$rel.'" type="'.$type.'" '; if ($media !== '') { $link .= 'media="'.$media.'" '; } if ($title !== '') { $link .= 'title="'.$title.'" '; } } return $link."/>\n"; } } // ------------------------------------------------------------------------ if ( ! function_exists('meta')) { /** * Generates meta tags from an array of key/values * * @param array * @param string * @param string * @param string * @return string */ function meta($name = '', $content = '', $type = 'name', $newline = "\n") { // Since we allow the data to be passes as a string, a simple array // or a multidimensional one, we need to do a little prepping. if ( ! is_array($name)) { $name = array(array('name' => $name, 'content' => $content, 'type' => $type, 'newline' => $newline)); } elseif (isset($name['name'])) { // Turn single array into multidimensional $name = array($name); } $str = ''; foreach ($name as $meta) { $type = (isset($meta['type']) && $meta['type'] !== 'name') ? 'http-equiv' : 'name'; $name = isset($meta['name']) ? $meta['name'] : ''; $content = isset($meta['content']) ? $meta['content'] : ''; $newline = isset($meta['newline']) ? $meta['newline'] : "\n"; $str .= ''.$newline; } return $str; } } // ------------------------------------------------------------------------ if ( ! function_exists('br')) { /** * Generates HTML BR tags based on number supplied * * @deprecated 3.0.0 Use str_repeat() instead * @param int $count Number of times to repeat the tag * @return string */ function br($count = 1) { return str_repeat('
    ', $count); } } // ------------------------------------------------------------------------ if ( ! function_exists('nbs')) { /** * Generates non-breaking space entities based on number supplied * * @deprecated 3.0.0 Use str_repeat() instead * @param int * @return string */ function nbs($num = 1) { return str_repeat(' ', $num); } } PK!E E path_helper.phpnu[input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure, $httponly); } } // -------------------------------------------------------------------- if ( ! function_exists('get_cookie')) { /** * Fetch an item from the COOKIE array * * @param string * @param bool * @return mixed */ function get_cookie($index, $xss_clean = NULL) { is_bool($xss_clean) OR $xss_clean = (config_item('global_xss_filtering') === TRUE); $prefix = isset($_COOKIE[$index]) ? '' : config_item('cookie_prefix'); return get_instance()->input->cookie($prefix.$index, $xss_clean); } } // -------------------------------------------------------------------- if ( ! function_exists('delete_cookie')) { /** * Delete a COOKIE * * @param mixed * @param string the cookie domain. Usually: .yourdomain.com * @param string the cookie path * @param string the cookie prefix * @return void */ function delete_cookie($name, $domain = '', $path = '/', $prefix = '') { set_cookie($name, '', '', $domain, $path, $prefix); } } PK!Uԡ88text_helper.phpnu[= $n) { $out = trim($out); return (mb_strlen($out) === mb_strlen($str)) ? $out : $out.$end_char; } } } } // ------------------------------------------------------------------------ if ( ! function_exists('ascii_to_entities')) { /** * High ASCII to Entities * * Converts high ASCII text and MS Word special characters to character entities * * @param string $str * @return string */ function ascii_to_entities($str) { $out = ''; $length = defined('MB_OVERLOAD_STRING') ? mb_strlen($str, '8bit') - 1 : strlen($str) - 1; for ($i = 0, $count = 1, $temp = array(); $i <= $length; $i++) { $ordinal = ord($str[$i]); if ($ordinal < 128) { /* If the $temp array has a value but we have moved on, then it seems only fair that we output that entity and restart $temp before continuing. -Paul */ if (count($temp) === 1) { $out .= '&#'.array_shift($temp).';'; $count = 1; } $out .= $str[$i]; } else { if (count($temp) === 0) { $count = ($ordinal < 224) ? 2 : 3; } $temp[] = $ordinal; if (count($temp) === $count) { $number = ($count === 3) ? (($temp[0] % 16) * 4096) + (($temp[1] % 64) * 64) + ($temp[2] % 64) : (($temp[0] % 32) * 64) + ($temp[1] % 64); $out .= '&#'.$number.';'; $count = 1; $temp = array(); } // If this is the last iteration, just output whatever we have elseif ($i === $length) { $out .= '&#'.implode(';', $temp).';'; } } } return $out; } } // ------------------------------------------------------------------------ if ( ! function_exists('entities_to_ascii')) { /** * Entities to ASCII * * Converts character entities back to ASCII * * @param string * @param bool * @return string */ function entities_to_ascii($str, $all = TRUE) { if (preg_match_all('/\&#(\d+)\;/', $str, $matches)) { for ($i = 0, $s = count($matches[0]); $i < $s; $i++) { $digits = $matches[1][$i]; $out = ''; if ($digits < 128) { $out .= chr($digits); } elseif ($digits < 2048) { $out .= chr(192 + (($digits - ($digits % 64)) / 64)).chr(128 + ($digits % 64)); } else { $out .= chr(224 + (($digits - ($digits % 4096)) / 4096)) .chr(128 + ((($digits % 4096) - ($digits % 64)) / 64)) .chr(128 + ($digits % 64)); } $str = str_replace($matches[0][$i], $out, $str); } } if ($all) { return str_replace( array('&', '<', '>', '"', ''', '-'), array('&', '<', '>', '"', "'", '-'), $str ); } return $str; } } // ------------------------------------------------------------------------ if ( ! function_exists('word_censor')) { /** * Word Censoring Function * * Supply a string and an array of disallowed words and any * matched words will be converted to #### or to the replacement * word you've submitted. * * @param string the text string * @param string the array of censored words * @param string the optional replacement value * @return string */ function word_censor($str, $censored, $replacement = '') { if ( ! is_array($censored)) { return $str; } $str = ' '.$str.' '; // \w, \b and a few others do not match on a unicode character // set for performance reasons. As a result words like über // will not match on a word boundary. Instead, we'll assume that // a bad word will be bookeneded by any of these characters. $delim = '[-_\'\"`(){}<>\[\]|!?@#%&,.:;^~*+=\/ 0-9\n\r\t]'; foreach ($censored as $badword) { $badword = str_replace('\*', '\w*?', preg_quote($badword, '/')); if ($replacement !== '') { $str = preg_replace( "/({$delim})(".$badword.")({$delim})/i", "\\1{$replacement}\\3", $str ); } elseif (preg_match_all("/{$delim}(".$badword."){$delim}/i", $str, $matches, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE)) { $matches = $matches[1]; for ($i = count($matches) - 1; $i >= 0; $i--) { $length = strlen($matches[$i][0]); $str = substr_replace( $str, str_repeat('#', $length), $matches[$i][1], $length ); } } } return trim($str); } } // ------------------------------------------------------------------------ if ( ! function_exists('highlight_code')) { /** * Code Highlighter * * Colorizes code strings * * @param string the text string * @return string */ function highlight_code($str) { /* The highlight string function encodes and highlights * brackets so we need them to start raw. * * Also replace any existing PHP tags to temporary markers * so they don't accidentally break the string out of PHP, * and thus, thwart the highlighting. */ $str = str_replace( array('<', '>', '', '<%', '%>', '\\', ''), array('<', '>', 'phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'), $str ); // The highlight_string function requires that the text be surrounded // by PHP tags, which we will remove later $str = highlight_string('', TRUE); // Remove our artificially added PHP, and the syntax highlighting that came with it $str = preg_replace( array( '/<\?php( | )/i', '/(.*?)\?><\/span>\n<\/span>\n<\/code>/is', '/<\/span>/i' ), array( '', "$1\n\n", '' ), $str ); // Replace our markers back to PHP tags. return str_replace( array('phptagopen', 'phptagclose', 'asptagopen', 'asptagclose', 'backslashtmp', 'scriptclose'), array('<?', '?>', '<%', '%>', '\\', '</script>'), $str ); } } // ------------------------------------------------------------------------ if ( ! function_exists('highlight_phrase')) { /** * Phrase Highlighter * * Highlights a phrase within a text string * * @param string $str the text string * @param string $phrase the phrase you'd like to highlight * @param string $tag_open the openging tag to precede the phrase with * @param string $tag_close the closing tag to end the phrase with * @return string */ function highlight_phrase($str, $phrase, $tag_open = '', $tag_close = '') { return ($str !== '' && $phrase !== '') ? preg_replace('/('.preg_quote($phrase, '/').')/i'.(UTF8_ENABLED ? 'u' : ''), $tag_open.'\\1'.$tag_close, $str) : $str; } } // ------------------------------------------------------------------------ if ( ! function_exists('convert_accented_characters')) { /** * Convert Accented Foreign Characters to ASCII * * @param string $str Input string * @return string */ function convert_accented_characters($str) { static $array_from, $array_to; if ( ! is_array($array_from)) { if (file_exists(APPPATH.'config/foreign_chars.php')) { include(APPPATH.'config/foreign_chars.php'); } if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars.php')) { include(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars.php'); } if (empty($foreign_characters) OR ! is_array($foreign_characters)) { $array_from = array(); $array_to = array(); return $str; } $array_from = array_keys($foreign_characters); $array_to = array_values($foreign_characters); } return preg_replace($array_from, $array_to, $str); } } // ------------------------------------------------------------------------ if ( ! function_exists('word_wrap')) { /** * Word Wrap * * Wraps text at the specified character. Maintains the integrity of words. * Anything placed between {unwrap}{/unwrap} will not be word wrapped, nor * will URLs. * * @param string $str the text string * @param int $charlim = 76 the number of characters to wrap at * @return string */ function word_wrap($str, $charlim = 76) { // Set the character limit is_numeric($charlim) OR $charlim = 76; // Reduce multiple spaces $str = preg_replace('| +|', ' ', $str); // Standardize newlines if (strpos($str, "\r") !== FALSE) { $str = str_replace(array("\r\n", "\r"), "\n", $str); } // If the current word is surrounded by {unwrap} tags we'll // strip the entire chunk and replace it with a marker. $unwrap = array(); if (preg_match_all('|\{unwrap\}(.+?)\{/unwrap\}|s', $str, $matches)) { for ($i = 0, $c = count($matches[0]); $i < $c; $i++) { $unwrap[] = $matches[1][$i]; $str = str_replace($matches[0][$i], '{{unwrapped'.$i.'}}', $str); } } // Use PHP's native function to do the initial wordwrap. // We set the cut flag to FALSE so that any individual words that are // too long get left alone. In the next step we'll deal with them. $str = wordwrap($str, $charlim, "\n", FALSE); // Split the string into individual lines of text and cycle through them $output = ''; foreach (explode("\n", $str) as $line) { // Is the line within the allowed character count? // If so we'll join it to the output and continue if (mb_strlen($line) <= $charlim) { $output .= $line."\n"; continue; } $temp = ''; while (mb_strlen($line) > $charlim) { // If the over-length word is a URL we won't wrap it if (preg_match('!\[url.+\]|://|www\.!', $line)) { break; } // Trim the word down $temp .= mb_substr($line, 0, $charlim - 1); $line = mb_substr($line, $charlim - 1); } // If $temp contains data it means we had to split up an over-length // word into smaller chunks so we'll add it back to our current line if ($temp !== '') { $output .= $temp."\n".$line."\n"; } else { $output .= $line."\n"; } } // Put our markers back if (count($unwrap) > 0) { foreach ($unwrap as $key => $val) { $output = str_replace('{{unwrapped'.$key.'}}', $val, $output); } } return $output; } } // ------------------------------------------------------------------------ if ( ! function_exists('ellipsize')) { /** * Ellipsize String * * This function will strip tags from a string, split it at its max_length and ellipsize * * @param string string to ellipsize * @param int max length of string * @param mixed int (1|0) or float, .5, .2, etc for position to split * @param string ellipsis ; Default '...' * @return string ellipsized string */ function ellipsize($str, $max_length, $position = 1, $ellipsis = '…') { // Strip tags $str = trim(strip_tags($str)); // Is the string long enough to ellipsize? if (mb_strlen($str) <= $max_length) { return $str; } $beg = mb_substr($str, 0, floor($max_length * $position)); $position = ($position > 1) ? 1 : $position; if ($position === 1) { $end = mb_substr($str, 0, -($max_length - mb_strlen($beg))); } else { $end = mb_substr($str, -($max_length - mb_strlen($beg))); } return $beg.$ellipsis.$end; } } PK!u r directory_helper.phpnu[ 0) && is_dir($source_dir.$file)) { $filedata[$file] = directory_map($source_dir.$file, $new_depth, $hidden); } else { $filedata[] = $file; } } closedir($fp); return $filedata; } return FALSE; } } PK!8T!66url_helper.phpnu[config->site_url($uri, $protocol); } } // ------------------------------------------------------------------------ if ( ! function_exists('base_url')) { /** * Base URL * * Create a local URL based on your basepath. * Segments can be passed in as a string or an array, same as site_url * or a URL to a file can be passed in, e.g. to an image file. * * @param string $uri * @param string $protocol * @return string */ function base_url($uri = '', $protocol = NULL) { return get_instance()->config->base_url($uri, $protocol); } } // ------------------------------------------------------------------------ if ( ! function_exists('current_url')) { /** * Current URL * * Returns the full URL (including segments) of the page where this * function is placed * * @return string */ function current_url() { $CI =& get_instance(); return $CI->config->site_url($CI->uri->uri_string()); } } // ------------------------------------------------------------------------ if ( ! function_exists('uri_string')) { /** * URL String * * Returns the URI segments. * * @return string */ function uri_string() { return get_instance()->uri->uri_string(); } } // ------------------------------------------------------------------------ if ( ! function_exists('index_page')) { /** * Index page * * Returns the "index_page" from your config file * * @return string */ function index_page() { return get_instance()->config->item('index_page'); } } // ------------------------------------------------------------------------ if ( ! function_exists('anchor')) { /** * Anchor Link * * Creates an anchor based on the local URL. * * @param string the URL * @param string the link title * @param mixed any attributes * @return string */ function anchor($uri = '', $title = '', $attributes = '') { $title = (string) $title; $site_url = is_array($uri) ? site_url($uri) : (preg_match('#^(\w+:)?//#i', $uri) ? $uri : site_url($uri)); if ($title === '') { $title = $site_url; } if ($attributes !== '') { $attributes = _stringify_attributes($attributes); } return ''.$title.''; } } // ------------------------------------------------------------------------ if ( ! function_exists('anchor_popup')) { /** * Anchor Link - Pop-up version * * Creates an anchor based on the local URL. The link * opens a new window based on the attributes specified. * * @param string the URL * @param string the link title * @param mixed any attributes * @return string */ function anchor_popup($uri = '', $title = '', $attributes = FALSE) { $title = (string) $title; $site_url = preg_match('#^(\w+:)?//#i', $uri) ? $uri : site_url($uri); if ($title === '') { $title = $site_url; } if ($attributes === FALSE) { return '".$title.''; } if ( ! is_array($attributes)) { $attributes = array($attributes); // Ref: http://www.w3schools.com/jsref/met_win_open.asp $window_name = '_blank'; } elseif ( ! empty($attributes['window_name'])) { $window_name = $attributes['window_name']; unset($attributes['window_name']); } else { $window_name = '_blank'; } foreach (array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'menubar' => 'no', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0') as $key => $val) { $atts[$key] = isset($attributes[$key]) ? $attributes[$key] : $val; unset($attributes[$key]); } $attributes = _stringify_attributes($attributes); return ''.$title.''; } } // ------------------------------------------------------------------------ if ( ! function_exists('mailto')) { /** * Mailto Link * * @param string the email address * @param string the link title * @param mixed any attributes * @return string */ function mailto($email, $title = '', $attributes = '') { $title = (string) $title; if ($title === '') { $title = $email; } return ''.$title.''; } } // ------------------------------------------------------------------------ if ( ! function_exists('safe_mailto')) { /** * Encoded Mailto Link * * Create a spam-protected mailto link written in Javascript * * @param string the email address * @param string the link title * @param mixed any attributes * @return string */ function safe_mailto($email, $title = '', $attributes = '') { $title = (string) $title; if ($title === '') { $title = $email; } $x = str_split(' $val) { $x[] = ' '.$key.'="'; for ($i = 0, $l = strlen($val); $i < $l; $i++) { $x[] = '|'.ord($val[$i]); } $x[] = '"'; } } else { for ($i = 0, $l = strlen($attributes); $i < $l; $i++) { $x[] = $attributes[$i]; } } } $x[] = '>'; $temp = array(); for ($i = 0, $l = strlen($title); $i < $l; $i++) { $ordinal = ord($title[$i]); if ($ordinal < 128) { $x[] = '|'.$ordinal; } else { if (count($temp) === 0) { $count = ($ordinal < 224) ? 2 : 3; } $temp[] = $ordinal; if (count($temp) === $count) { $number = ($count === 3) ? (($temp[0] % 16) * 4096) + (($temp[1] % 64) * 64) + ($temp[2] % 64) : (($temp[0] % 32) * 64) + ($temp[1] % 64); $x[] = '|'.$number; $count = 1; $temp = array(); } } } $x[] = '<'; $x[] = '/'; $x[] = 'a'; $x[] = '>'; $x = array_reverse($x); $output = "'; return $output; } } // ------------------------------------------------------------------------ if ( ! function_exists('auto_link')) { /** * Auto-linker * * Automatically links URL and Email addresses. * Note: There's a bit of extra code here to deal with * URLs or emails that end in a period. We'll strip these * off and add them after the link. * * @param string the string * @param string the type: email, url, or both * @param bool whether to create pop-up links * @return string */ function auto_link($str, $type = 'both', $popup = FALSE) { // Find and replace any URLs. if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[a-z0-9]+(-+[a-z0-9]+)*(\.[a-z0-9]+(-+[a-z0-9]+)*)+(/([^\s()<>;]+\w)?/?)?#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { // Set our target HTML if using popup links. $target = ($popup) ? ' target="_blank"' : ''; // We process the links in reverse order (last -> first) so that // the returned string offsets from preg_match_all() are not // moved as we add more HTML. foreach (array_reverse($matches) as $match) { // $match[0] is the matched string/link // $match[1] is either a protocol prefix or 'www.' // // With PREG_OFFSET_CAPTURE, both of the above is an array, // where the actual value is held in [0] and its offset at the [1] index. $a = ''.$match[0][0].''; $str = substr_replace($str, $a, $match[0][1], strlen($match[0][0])); } } // Find and replace any emails. if ($type !== 'url' && preg_match_all('#([\w\.\-\+]+@[a-z0-9\-]+\.[a-z0-9\-\.]+[^[:punct:]\s])#i', $str, $matches, PREG_OFFSET_CAPTURE)) { foreach (array_reverse($matches[0]) as $match) { if (filter_var($match[0], FILTER_VALIDATE_EMAIL) !== FALSE) { $str = substr_replace($str, safe_mailto($match[0]), $match[1], strlen($match[0])); } } } return $str; } } // ------------------------------------------------------------------------ if ( ! function_exists('prep_url')) { /** * Prep URL * * Simply adds the http:// part if no scheme is included * * @param string the URL * @return string */ function prep_url($str = '') { if ($str === 'http://' OR $str === '') { return ''; } $url = parse_url($str); if ( ! $url OR ! isset($url['scheme'])) { return 'http://'.$str; } return $str; } } // ------------------------------------------------------------------------ if ( ! function_exists('url_title')) { /** * Create URL Title * * Takes a "title" string as input and creates a * human-friendly URL string with a "separator" string * as the word separator. * * @todo Remove old 'dash' and 'underscore' usage in 3.1+. * @param string $str Input string * @param string $separator Word separator * (usually '-' or '_') * @param bool $lowercase Whether to transform the output string to lowercase * @return string */ function url_title($str, $separator = '-', $lowercase = FALSE) { if ($separator === 'dash') { $separator = '-'; } elseif ($separator === 'underscore') { $separator = '_'; } $q_separator = preg_quote($separator, '#'); $trans = array( '&.+?;' => '', '[^\w\d _-]' => '', '\s+' => $separator, '('.$q_separator.')+' => $separator ); $str = strip_tags($str); foreach ($trans as $key => $val) { $str = preg_replace('#'.$key.'#i'.(UTF8_ENABLED ? 'u' : ''), $val, $str); } if ($lowercase === TRUE) { $str = strtolower($str); } return trim(trim($str, $separator)); } } // ------------------------------------------------------------------------ if ( ! function_exists('redirect')) { /** * Header Redirect * * Header redirect in two flavors * For very fine grained control over headers, you could use the Output * Library's set_header() function. * * @param string $uri URL * @param string $method Redirect method * 'auto', 'location' or 'refresh' * @param int $code HTTP Response status code * @return void */ function redirect($uri = '', $method = 'auto', $code = NULL) { if ( ! preg_match('#^(\w+:)?//#i', $uri)) { $uri = site_url($uri); } // IIS environment likely? Use 'refresh' for better compatibility if ($method === 'auto' && isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== FALSE) { $method = 'refresh'; } elseif ($method !== 'refresh' && (empty($code) OR ! is_numeric($code))) { if (isset($_SERVER['SERVER_PROTOCOL'], $_SERVER['REQUEST_METHOD']) && $_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.1') { $code = ($_SERVER['REQUEST_METHOD'] !== 'GET') ? 303 // reference: http://en.wikipedia.org/wiki/Post/Redirect/Get : 307; } else { $code = 302; } } switch ($method) { case 'refresh': header('Refresh:0;url='.$uri); break; default: header('Location: '.$uri, TRUE, $code); break; } exit; } } PK!rv array_helper.phpnu[field_id pairs * @param string field_id if alias name was passed in * @param bool * @return array */ function smiley_js($alias = '', $field_id = '', $inline = TRUE) { static $do_setup = TRUE; $r = ''; if ($alias !== '' && ! is_array($alias)) { $alias = array($alias => $field_id); } if ($do_setup === TRUE) { $do_setup = FALSE; $m = array(); if (is_array($alias)) { foreach ($alias as $name => $id) { $m[] = '"'.$name.'" : "'.$id.'"'; } } $m = '{'.implode(',', $m).'}'; $r .= << $id) { $r .= 'smiley_map["'.$name.'"] = "'.$id."\";\n"; } } return ($inline) ? '' : $r; } } // ------------------------------------------------------------------------ if ( ! function_exists('get_clickable_smileys')) { /** * Get Clickable Smileys * * Returns an array of image tag links that can be clicked to be inserted * into a form field. * * @param string the URL to the folder containing the smiley images * @param array * @return array */ function get_clickable_smileys($image_url, $alias = '') { // For backward compatibility with js_insert_smiley if (is_array($alias)) { $smileys = $alias; } elseif (FALSE === ($smileys = _get_smiley_array())) { return FALSE; } // Add a trailing slash to the file path if needed $image_url = rtrim($image_url, '/').'/'; $used = array(); foreach ($smileys as $key => $val) { // Keep duplicates from being used, which can happen if the // mapping array contains multiple identical replacements. For example: // :-) and :) might be replaced with the same image so both smileys // will be in the array. if (isset($used[$smileys[$key][0]])) { continue; } $link[] = ''.$smileys[$key][3].''; $used[$smileys[$key][0]] = TRUE; } return $link; } } // ------------------------------------------------------------------------ if ( ! function_exists('parse_smileys')) { /** * Parse Smileys * * Takes a string as input and swaps any contained smileys for the actual image * * @param string the text to be parsed * @param string the URL to the folder containing the smiley images * @param array * @return string */ function parse_smileys($str = '', $image_url = '', $smileys = NULL) { if ($image_url === '' OR ( ! is_array($smileys) && FALSE === ($smileys = _get_smiley_array()))) { return $str; } // Add a trailing slash to the file path if needed $image_url = rtrim($image_url, '/').'/'; foreach ($smileys as $key => $val) { $str = str_replace($key, ''.$smileys[$key][3].'', $str); } return $str; } } // ------------------------------------------------------------------------ if ( ! function_exists('_get_smiley_array')) { /** * Get Smiley Array * * Fetches the config/smiley.php file * * @return mixed */ function _get_smiley_array() { static $_smileys; if ( ! is_array($_smileys)) { if (file_exists(APPPATH.'config/smileys.php')) { include(APPPATH.'config/smileys.php'); } if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php')) { include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); } if (empty($smileys) OR ! is_array($smileys)) { $_smileys = array(); return FALSE; } $_smileys = $smileys; } return $_smileys; } } PK!5: typography_helper.phpnu[load->library('typography'); return $CI->typography->nl2br_except_pre($str); } } // ------------------------------------------------------------------------ if ( ! function_exists('auto_typography')) { /** * Auto Typography Wrapper Function * * @param string $str * @param bool $reduce_linebreaks = FALSE whether to reduce multiple instances of double newlines to two * @return string */ function auto_typography($str, $reduce_linebreaks = FALSE) { $CI =& get_instance(); $CI->load->library('typography'); return $CI->typography->auto_typography($str, $reduce_linebreaks); } } // -------------------------------------------------------------------- if ( ! function_exists('entity_decode')) { /** * HTML Entities Decode * * This function is a replacement for html_entity_decode() * * @param string * @param string * @return string */ function entity_decode($str, $charset = NULL) { return get_instance()->security->entity_decode($str, $charset); } } PK!ͫxxsecurity_helper.phpnu[security->xss_clean($str, $is_image); } } // ------------------------------------------------------------------------ if ( ! function_exists('sanitize_filename')) { /** * Sanitize Filename * * @param string * @return string */ function sanitize_filename($filename) { return get_instance()->security->sanitize_filename($filename); } } // -------------------------------------------------------------------- if ( ! function_exists('do_hash')) { /** * Hash encode a string * * @todo Remove in version 3.1+. * @deprecated 3.0.0 Use PHP's native hash() instead. * @param string $str * @param string $type = 'sha1' * @return string */ function do_hash($str, $type = 'sha1') { if ( ! in_array(strtolower($type), hash_algos())) { $type = 'md5'; } return hash($type, $str); } } // ------------------------------------------------------------------------ if ( ! function_exists('strip_image_tags')) { /** * Strip Image Tags * * @param string * @return string */ function strip_image_tags($str) { return get_instance()->security->strip_image_tags($str); } } // ------------------------------------------------------------------------ if ( ! function_exists('encode_php_tags')) { /** * Convert PHP tags to entities * * @param string * @return string */ function encode_php_tags($str) { return str_replace(array(''), array('<?', '?>'), $str); } } PK!']]form_helper.phpnu[config->site_url($CI->uri->uri_string()); } // If an action is not a full URL then turn it into one elseif (strpos($action, '://') === FALSE) { $action = $CI->config->site_url($action); } $attributes = _attributes_to_string($attributes); if (stripos($attributes, 'method=') === FALSE) { $attributes .= ' method="post"'; } if (stripos($attributes, 'accept-charset=') === FALSE) { $attributes .= ' accept-charset="'.strtolower(config_item('charset')).'"'; } $form = '
    \n"; if (is_array($hidden)) { foreach ($hidden as $name => $value) { $form .= ''."\n"; } } // Add CSRF field if enabled, but leave it out for GET requests and requests to external websites if ($CI->config->item('csrf_protection') === TRUE && strpos($action, $CI->config->base_url()) !== FALSE && ! stripos($form, 'method="get"')) { // Prepend/append random-length "white noise" around the CSRF // token input, as a form of protection against BREACH attacks if (FALSE !== ($noise = $CI->security->get_random_bytes(1))) { list(, $noise) = unpack('c', $noise); } else { $noise = mt_rand(-128, 127); } // Prepend if $noise has a negative value, append if positive, do nothing for zero $prepend = $append = ''; if ($noise < 0) { $prepend = str_repeat(" ", abs($noise)); } elseif ($noise > 0) { $append = str_repeat(" ", $noise); } $form .= sprintf( '%s%s%s', $prepend, $CI->security->get_csrf_token_name(), $CI->security->get_csrf_hash(), $append, "\n" ); } return $form; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_open_multipart')) { /** * Form Declaration - Multipart type * * Creates the opening portion of the form, but with "multipart/form-data". * * @param string the URI segments of the form destination * @param array a key/value pair of attributes * @param array a key/value pair hidden data * @return string */ function form_open_multipart($action = '', $attributes = array(), $hidden = array()) { if (is_string($attributes)) { $attributes .= ' enctype="multipart/form-data"'; } else { $attributes['enctype'] = 'multipart/form-data'; } return form_open($action, $attributes, $hidden); } } // ------------------------------------------------------------------------ if ( ! function_exists('form_hidden')) { /** * Hidden Input Field * * Generates hidden fields. You can pass a simple key/value string or * an associative array with multiple values. * * @param mixed $name Field name * @param string $value Field value * @param bool $recursing * @return string */ function form_hidden($name, $value = '', $recursing = FALSE) { static $form; if ($recursing === FALSE) { $form = "\n"; } if (is_array($name)) { foreach ($name as $key => $val) { form_hidden($key, $val, TRUE); } return $form; } if ( ! is_array($value)) { $form .= '\n"; } else { foreach ($value as $k => $v) { $k = is_int($k) ? '' : $k; form_hidden($name.'['.$k.']', $v, TRUE); } } return $form; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_input')) { /** * Text Input Field * * @param mixed * @param string * @param mixed * @return string */ function form_input($data = '', $value = '', $extra = '') { $defaults = array( 'type' => 'text', 'name' => is_array($data) ? '' : $data, 'value' => $value ); return '\n"; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_password')) { /** * Password Field * * Identical to the input function but adds the "password" type * * @param mixed * @param string * @param mixed * @return string */ function form_password($data = '', $value = '', $extra = '') { is_array($data) OR $data = array('name' => $data); $data['type'] = 'password'; return form_input($data, $value, $extra); } } // ------------------------------------------------------------------------ if ( ! function_exists('form_upload')) { /** * Upload Field * * Identical to the input function but adds the "file" type * * @param mixed * @param string * @param mixed * @return string */ function form_upload($data = '', $value = '', $extra = '') { $defaults = array('type' => 'file', 'name' => ''); is_array($data) OR $data = array('name' => $data); $data['type'] = 'file'; return '\n"; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_textarea')) { /** * Textarea field * * @param mixed $data * @param string $value * @param mixed $extra * @return string */ function form_textarea($data = '', $value = '', $extra = '') { $defaults = array( 'name' => is_array($data) ? '' : $data, 'cols' => '40', 'rows' => '10' ); if ( ! is_array($data) OR ! isset($data['value'])) { $val = $value; } else { $val = $data['value']; unset($data['value']); // textareas don't use the value attribute } return '\n"; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_multiselect')) { /** * Multi-select menu * * @param string * @param array * @param mixed * @param mixed * @return string */ function form_multiselect($name = '', $options = array(), $selected = array(), $extra = '') { $extra = _attributes_to_string($extra); if (stripos($extra, 'multiple') === FALSE) { $extra .= ' multiple="multiple"'; } return form_dropdown($name, $options, $selected, $extra); } } // -------------------------------------------------------------------- if ( ! function_exists('form_dropdown')) { /** * Drop-down Menu * * @param mixed $data * @param mixed $options * @param mixed $selected * @param mixed $extra * @return string */ function form_dropdown($data = '', $options = array(), $selected = array(), $extra = '') { $defaults = array(); if (is_array($data)) { if (isset($data['selected'])) { $selected = $data['selected']; unset($data['selected']); // select tags don't have a selected attribute } if (isset($data['options'])) { $options = $data['options']; unset($data['options']); // select tags don't use an options attribute } } else { $defaults = array('name' => $data); } is_array($selected) OR $selected = array($selected); is_array($options) OR $options = array($options); // If no selected state was submitted we will attempt to set it automatically if (empty($selected)) { if (is_array($data)) { if (isset($data['name'], $_POST[$data['name']])) { $selected = array($_POST[$data['name']]); } } elseif (isset($_POST[$data])) { $selected = array($_POST[$data]); } } $extra = _attributes_to_string($extra); $multiple = (count($selected) > 1 && stripos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : ''; $form = '\n"; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_checkbox')) { /** * Checkbox Field * * @param mixed * @param string * @param bool * @param mixed * @return string */ function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '') { $defaults = array('type' => 'checkbox', 'name' => ( ! is_array($data) ? $data : ''), 'value' => $value); if (is_array($data) && array_key_exists('checked', $data)) { $checked = $data['checked']; if ($checked == FALSE) { unset($data['checked']); } else { $data['checked'] = 'checked'; } } if ($checked == TRUE) { $defaults['checked'] = 'checked'; } else { unset($defaults['checked']); } return '\n"; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_radio')) { /** * Radio Button * * @param mixed * @param string * @param bool * @param mixed * @return string */ function form_radio($data = '', $value = '', $checked = FALSE, $extra = '') { is_array($data) OR $data = array('name' => $data); $data['type'] = 'radio'; return form_checkbox($data, $value, $checked, $extra); } } // ------------------------------------------------------------------------ if ( ! function_exists('form_submit')) { /** * Submit Button * * @param mixed * @param string * @param mixed * @return string */ function form_submit($data = '', $value = '', $extra = '') { $defaults = array( 'type' => 'submit', 'name' => is_array($data) ? '' : $data, 'value' => $value ); return '\n"; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_reset')) { /** * Reset Button * * @param mixed * @param string * @param mixed * @return string */ function form_reset($data = '', $value = '', $extra = '') { $defaults = array( 'type' => 'reset', 'name' => is_array($data) ? '' : $data, 'value' => $value ); return '\n"; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_button')) { /** * Form Button * * @param mixed * @param string * @param mixed * @return string */ function form_button($data = '', $content = '', $extra = '') { $defaults = array( 'name' => is_array($data) ? '' : $data, 'type' => 'button' ); if (is_array($data) && isset($data['content'])) { $content = $data['content']; unset($data['content']); // content is not an attribute } return '\n"; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_label')) { /** * Form Label Tag * * @param string The text to appear onscreen * @param string The id the label applies to * @param mixed Additional attributes * @return string */ function form_label($label_text = '', $id = '', $attributes = array()) { $label = ''.$label_text.''; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_fieldset')) { /** * Fieldset Tag * * Used to produce
    text. To close fieldset * use form_fieldset_close() * * @param string The legend text * @param array Additional attributes * @return string */ function form_fieldset($legend_text = '', $attributes = array()) { $fieldset = '\n"; if ($legend_text !== '') { return $fieldset.''.$legend_text."\n"; } return $fieldset; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_fieldset_close')) { /** * Fieldset Close Tag * * @param string * @return string */ function form_fieldset_close($extra = '') { return '
    '.$extra; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_close')) { /** * Form Close Tag * * @param string * @return string */ function form_close($extra = '') { return ''.$extra; } } // ------------------------------------------------------------------------ if ( ! function_exists('form_prep')) { /** * Form Prep * * Formats text so that it can be safely placed in a form field in the event it has HTML tags. * * @deprecated 3.0.0 An alias for html_escape() * @param string|string[] $str Value to escape * @return string|string[] Escaped values */ function form_prep($str) { return html_escape($str, TRUE); } } // ------------------------------------------------------------------------ if ( ! function_exists('set_value')) { /** * Form Value * * Grabs a value from the POST array for the specified field so you can * re-populate an input field or textarea. If Form Validation * is active it retrieves the info from the validation class * * @param string $field Field name * @param string $default Default value * @param bool $html_escape Whether to escape HTML special characters or not * @return string */ function set_value($field, $default = '', $html_escape = TRUE) { $CI =& get_instance(); $value = (isset($CI->form_validation) && is_object($CI->form_validation) && $CI->form_validation->has_rule($field)) ? $CI->form_validation->set_value($field, $default) : $CI->input->post($field, FALSE); isset($value) OR $value = $default; return ($html_escape) ? html_escape($value) : $value; } } // ------------------------------------------------------------------------ if ( ! function_exists('set_select')) { /** * Set Select * * Let's you set the selected value of a \n"; foreach (timezones() as $key => $val) { $selected = ($default === $key) ? ' selected="selected"' : ''; $menu .= '\n"; } return $menu.''; } } // ------------------------------------------------------------------------ if ( ! function_exists('timezones')) { /** * Timezones * * Returns an array of timezones. This is a helper function * for various other ones in this library * * @param string timezone * @return string */ function timezones($tz = '') { // Note: Don't change the order of these even though // some items appear to be in the wrong order $zones = array( 'UM12' => -12, 'UM11' => -11, 'UM10' => -10, 'UM95' => -9.5, 'UM9' => -9, 'UM8' => -8, 'UM7' => -7, 'UM6' => -6, 'UM5' => -5, 'UM45' => -4.5, 'UM4' => -4, 'UM35' => -3.5, 'UM3' => -3, 'UM2' => -2, 'UM1' => -1, 'UTC' => 0, 'UP1' => +1, 'UP2' => +2, 'UP3' => +3, 'UP35' => +3.5, 'UP4' => +4, 'UP45' => +4.5, 'UP5' => +5, 'UP55' => +5.5, 'UP575' => +5.75, 'UP6' => +6, 'UP65' => +6.5, 'UP7' => +7, 'UP8' => +8, 'UP875' => +8.75, 'UP9' => +9, 'UP95' => +9.5, 'UP10' => +10, 'UP105' => +10.5, 'UP11' => +11, 'UP115' => +11.5, 'UP12' => +12, 'UP1275' => +12.75, 'UP13' => +13, 'UP14' => +14 ); if ($tz === '') { return $zones; } return isset($zones[$tz]) ? $zones[$tz] : 0; } } // ------------------------------------------------------------------------ if ( ! function_exists('date_range')) { /** * Date range * * Returns a list of dates within a specified period. * * @param int unix_start UNIX timestamp of period start date * @param int unix_end|days UNIX timestamp of period end date * or interval in days. * @param mixed is_unix Specifies whether the second parameter * is a UNIX timestamp or a day interval * - TRUE or 'unix' for a timestamp * - FALSE or 'days' for an interval * @param string date_format Output date format, same as in date() * @return array */ function date_range($unix_start = '', $mixed = '', $is_unix = TRUE, $format = 'Y-m-d') { if ($unix_start == '' OR $mixed == '' OR $format == '') { return FALSE; } $is_unix = ! ( ! $is_unix OR $is_unix === 'days'); // Validate input and try strtotime() on invalid timestamps/intervals, just in case if ( ( ! ctype_digit((string) $unix_start) && ($unix_start = @strtotime($unix_start)) === FALSE) OR ( ! ctype_digit((string) $mixed) && ($is_unix === FALSE OR ($mixed = @strtotime($mixed)) === FALSE)) OR ($is_unix === TRUE && $mixed < $unix_start)) { return FALSE; } if ($is_unix && ($unix_start == $mixed OR date($format, $unix_start) === date($format, $mixed))) { return array(date($format, $unix_start)); } $range = array(); $from = new DateTime(); $from->setTimestamp($unix_start); if ($is_unix) { $arg = new DateTime(); $arg->setTimestamp($mixed); } else { $arg = (int) $mixed; } $period = new DatePeriod($from, new DateInterval('P1D'), $arg); foreach ($period as $date) { $range[] = $date->format($format); } /* If a period end date was passed to the DatePeriod constructor, it might not * be in our results. Not sure if this is a bug or it's just possible because * the end date might actually be less than 24 hours away from the previously * generated DateTime object, but either way - we have to append it manually. */ if ( ! is_int($arg) && $range[count($range) - 1] !== $arg->format($format)) { $range[] = $arg->format($format); } return $range; } } PK!!ݿssip.xmlnu[ PK!* zzsane.xmlnu[ PK!6ƽzzRAS.xmlnu[ PK!)"snmp.xmlnu[ PK![&xxtftp.xmlnu[ PK!Qirc.xmlnu[ PK! m"netbios-ns.xmlnu[ PK!/}} amanda.xmlnu[ PK!ZZ proto-gre.xmlnu[ PK!rzz Q.931.xmlnu[ PK!1}9pptp.xmlnu[ PK!ƻUUh323.xmlnu[ PK!w_wwftp.xmlnu[ PK!KWisPrimitive.jsnu[module.exports = function isPrimitive(value) { return value === null || (typeof value !== 'function' && typeof value !== 'object'); }; PK!,q%q%captcha_helper.phpnu[PK!ڌ%%%html_helper.phpnu[PK!E E Kpath_helper.phpnu[PK!Һ7_"Wcookie_helper.phpnu[PK!Uԡ88fftext_helper.phpnu[PK!u r Fdirectory_helper.phpnu[PK!8T!66url_helper.phpnu[PK!rv Larray_helper.phpnu[PK!3smiley_helper.phpnu[PK!5: n typography_helper.phpnu[PK!ͫxxnsecurity_helper.phpnu[PK!']])(form_helper.phpnu[PK!6R沨//gfile_helper.phpnu[PK!h Nnumber_helper.phpnu[PK!= ˏ;string_helper.phpnu[PK!  language_helper.phpnu[PK!uZdownload_helper.phpnu[PK!ҹ̽ ~email_helper.phpnu[PK!\Iinflector_helper.phpnu[PK!( $index.htmlnu[PK!dc0 0 Q%xml_helper.phpnu[PK!{FEE0date_helper.phpnu[PK!!ݿsvsip.xmlnu[PK!* zzvsane.xmlnu[PK!6ƽzzwRAS.xmlnu[PK!)">xsnmp.xmlnu[PK![&xxxtftp.xmlnu[PK!Qyirc.xmlnu[PK! m"jznetbios-ns.xmlnu[PK!/}} 5{amanda.xmlnu[PK!ZZ {proto-gre.xmlnu[PK!rzz |Q.931.xmlnu[PK!1}96}pptp.xmlnu[PK!ƻUU}h323.xmlnu[PK!w_ww~ftp.xmlnu[PK!KW1isPrimitive.jsnu[PK$$