/**
  * Filters the `tribe_events_category_slug` to return the category slug that's WPML aware.
  *
  * WPML does not currently support translation of custom taxonomies root ,e.g. `category` in
  * The Events Calendar case. But we do take WPML-managed translations of the `category` slug
  * into account in our rewrite rules and try to show a localized version of the `category` slug
  * in the permalinks.
  *
  * @param string $slug The original, possibily translated, category slug.
  *
  * @return string The category slug in its ENG form if the Events Category translation is not active
  *                or in a translation that The Events Calendar supports.
  */
 public function filter_tribe_events_category_slug($slug)
 {
     /** @var SitePress $sitepress */
     global $sitepress;
     $tax_sync_options = $sitepress->get_setting('taxonomies_sync_option');
     $translate_event_cat = !empty($tax_sync_options[Tribe__Events__Main::TAXONOMY]);
     $using_lang_query_var = $sitepress->get_setting('language_negotiation_type') == 3;
     if (!$translate_event_cat || $using_lang_query_var) {
         $slug = 'category';
     } else {
         $lang = $sitepress->get_locale(ICL_LANGUAGE_CODE);
         $tec_translation = Tribe__Events__Integrations__WPML__Utils::get_wpml_i18n_strings(array('category'), $lang);
         $slug = !empty($tec_translation[0]) ? end($tec_translation[0]) : $slug;
         $remove_accents = true;
         /**
          * Whether accents should be removed from the translated slug or not.
          *
          * Returning a falsy value here will prevent accents from being removed.
          * E.g. "catégorie" would become "categorie" if this filter value is truthy;
          * it would instead remain unchanged if this filters returns a falsy value.
          *
          * @param bool $remove_accents Defaults to `true`.
          */
         $remove_accents = apply_filters('tribe_events_integrations_category_slug_remove_accents', $remove_accents);
         if ($remove_accents) {
             $slug = remove_accents(urldecode($slug));
         }
     }
     return $slug;
 }
 function make_url($string)
 {
     $ci = load_ci();
     $string = remove_accents($string);
     //$string = htmlspecialchars($string);
     $string = strtolower($string);
     // Force lowercase
     $space_chars = array(" ", "…", "–", "—", "/", "\\", ":", ";", ".", "+", "#", "~", "_", "|");
     foreach ($space_chars as $char) {
         $string = str_replace($char, '-', $string);
         // Change spaces to dashes
     }
     // Only allow letters, numbers, and dashes
     $string = preg_replace('/([^a-zA-Z0-9\\-]+)/', '', $string);
     $string = preg_replace('/-+/', '-', $string);
     // Clean up extra dashes
     if (substr($string, -1) === '-') {
         // Remove - from end
         $string = substr($string, 0, -1);
     }
     if (substr($string, 0, 1) === '-') {
         // Remove - from start
         $string = substr($string, 1);
     }
     return $string;
 }
示例#3
0
function osc_sanitizeString($string) {
    $string = strip_tags($string);
    $string = preg_replace('/%([a-fA-F0-9][a-fA-F0-9])/', '--$1--', $string);
    $string = str_replace('%', '', $string);
    $string = preg_replace('/--([a-fA-F0-9][a-fA-F0-9])--/', '%$1', $string);

    $string = remove_accents($string);

    $string = strtolower($string);
    // @TODO  retrieve $arr_stop_words from Locale user custom list. as editable in /oc-admin/index.php?page=languages
    //        and do a 
    //        str_replace($arr_stop_words, '', $string);
    $string = preg_replace('/&.+?;/', '', $string);
    $string = str_replace(array('.','\'','--'), '-', $string);
    $string = preg_replace('/\s+/', '-', $string);
    $string = preg_replace('|[\p{Ps}\p{Pe}\p{Pi}\p{Pf}\p{Po}\p{S}\p{Z}\p{C}\p{No}]+|u', '', $string);

    if( is_utf8($string) ) {
        $string = urlencode($string);
        // mdash & ndash
        $string = str_replace(array('%e2%80%93', '%e2%80%94'), '-', strtolower($string));
    }

    $string = preg_replace('/-+/', '-', $string);
    $string = trim($string, '-');

    return $string;
}
示例#4
0
 function listAccounts($ipageindex)
 {
     $this->checkAdmin();
     $cond_email = isset($_GET['cond_email']) ? $_GET['cond_email'] : null;
     $strWhere = '';
     if (isset($cond_email) && $cond_email != '') {
         $cond_email = mysql_real_escape_string($cond_email);
         $cond_email = strtolower(remove_accents($cond_email));
         $strWhere .= " and username like '%{$cond_email}%'";
     }
     $this->account->orderBy('id', 'desc');
     $this->account->where($strWhere);
     $this->account->setPage($ipageindex);
     $this->account->setLimit(PAGINATE_LIMIT);
     $lstAccounts = $this->account->search();
     $totalPages = $this->account->totalPages();
     $ipagesbefore = $ipageindex - INT_PAGE_SUPPORT;
     if ($ipagesbefore < 1) {
         $ipagesbefore = 1;
     }
     $ipagesnext = $ipageindex + INT_PAGE_SUPPORT;
     if ($ipagesnext > $totalPages) {
         $ipagesnext = $totalPages;
     }
     $this->set('lstAccounts', $lstAccounts);
     $this->set('pagesindex', $ipageindex);
     $this->set('pagesbefore', $ipagesbefore);
     $this->set('pagesnext', $ipagesnext);
     $this->set('pageend', $totalPages);
     $this->_template->renderPage();
 }
示例#5
0
文件: forum.php 项目: rbraband/LouCes
 function sanitize_title_with_dashes($title)
 {
     $title = strip_tags($title);
     // Preserve escaped octets.
     $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
     // Remove percent signs that are not part of an octet.
     $title = str_replace('%', '', $title);
     // Restore octets.
     $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);
     $title = remove_accents($title);
     if (!mb_check_encoding($title, 'UTF-8')) {
         if (function_exists('mb_strtolower')) {
             $title = mb_strtolower($title, 'UTF-8');
         }
         $title = urlencode($title);
     }
     $title = strtolower($title);
     $title = preg_replace('/&.+?;/', '', $title);
     // kill entities
     $title = str_replace('.', '-', $title);
     $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
     $title = preg_replace('/\\s+/', '-', $title);
     $title = preg_replace('|-+|', '-', $title);
     $title = trim($title, '-');
     return $title;
 }
示例#6
0
function get_uri($title)
{
    $title = strip_tags($title);
    // Preserve escaped octets.
    //$title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
    // Remove percent signs that are not part of an octet.
    //$title = str_replace('%', '', $title);
    // Restore octets.
    //$title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);
    $title = remove_accents($title);
    $title = mb_strtolower($title, 'UTF-8');
    $title = preg_replace('/&.+?;/', '', $title);
    // kill entities
    //$title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
    $title = preg_replace('/[\\W¿¡]+/u', '-', $title);
    $title = preg_replace('/[^a-z0-9,;:\\]\\[\\(\\)\\. _-]/', '', $title);
    $title = preg_replace('/\\.+$|^\\.+/', '', $title);
    $title = preg_replace('/\\.+-|-\\.+/', '-', $title);
    $title = preg_replace('|-+|', '-', $title);
    $title = remove_shorts($title);
    $words = preg_split('/-/', $title);
    $uri = '';
    foreach ($words as $word) {
        if (!empty($word) && $word != '-' && strlen($word) + strlen($uri) < 65) {
            $uri .= $word . '-';
        }
    }
    if (strlen($uri) < 5) {
        // Just in case if there were no short words
        $uri = substr($title, 0, 50);
    }
    $uri = trim($uri, '-');
    return $uri;
}
示例#7
0
 /**
  * Format URI
  * 
  * Formats a category uri.
  * 
  * @param	string $cat_uri The uri name
  * @uses 	check_uri
  * @uses		remove_accents
  * @uses		seems_utf8
  * @uses		utf8_uri_encode
  * @uses		format_uri
  * @return	string A cleaned uri
  */
 function format_uri($cat_uri, $i = 0, $cat_id = false)
 {
     $cat_uri = strip_tags($cat_uri);
     // Preserve escaped octets.
     $cat_uri = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $cat_uri);
     // Remove percent signs that are not part of an octet.
     $cat_uri = str_replace('%', '', $cat_uri);
     // Restore octets.
     $cat_uri = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $cat_uri);
     $cat_uri = remove_accents($cat_uri);
     if (seems_utf8($cat_uri)) {
         if (function_exists('mb_strtolower')) {
             $cat_uri = mb_strtolower($cat_uri, 'UTF-8');
         }
         $cat_uri = utf8_uri_encode($cat_uri, 200);
     }
     $cat_uri = strtolower($cat_uri);
     $cat_uri = preg_replace('/&.+?;/', '', $cat_uri);
     // kill entities
     $cat_uri = preg_replace('/[^%a-z0-9 _-]/', '', $cat_uri);
     $cat_uri = preg_replace('/\\s+/', '-', $cat_uri);
     $cat_uri = preg_replace('|-+|', '-', $cat_uri);
     $cat_uri = trim($cat_uri, '-');
     if ($i > 0) {
         $cat_uri = $cat_uri . "-" . $i;
     }
     if (!$this->check_uri($cat_uri, $cat_id)) {
         $i++;
         $cat_uri = $this->format_uri($cat_uri, $i);
     }
     return $cat_uri;
 }
 /**
  * Removes all accents from string
  * @param string $filename - any filename with absolute path
  * @param bool $sanitize - Sanitized all special characters as well?
  */
 public static function remove_accents($filename, $sanitize = true)
 {
     # Get path and basename
     $file_info = pathinfo($filename);
     $filename = $file_info['basename'];
     # If available remove all NFD characters before doing anything else
     if (class_exists('Normalizer')) {
         $filename = Normalizer::normalize($filename, Normalizer::FORM_C);
     }
     # Removes accents using wordpress function
     $filename = remove_accents($filename);
     if ($sanitize) {
         # Sanitize special characters for files so that they work in urls
         $filename = sanitize_file_name($filename);
     }
     # And then just remove anything fancy like ¼ and ™
     $filename = self::remove_non_ascii_characters($filename);
     # If this was full path return it like it was before
     # pathinfo returns . for only filenames
     if ($file_info['dirname'] != '.') {
         $filename = $file_info['dirname'] . '/' . $filename;
     }
     # Return full path
     return $filename;
 }
示例#9
0
 public function executeView()
 {
     sfLoader::loadHelpers(array('General', 'MetaLink'));
     parent::executeView();
     // we get the user (id + name) who first uploaded this picture:
     $this->creator = $this->document->getCreator();
     $this->image_type = $this->document['image_type'];
     if (!$this->document->isArchive() && $this->document['redirects_to'] == NULL) {
         // here, we add the summit name to route names :
         $associated_routes = array_filter($this->associated_docs, array('c2cTools', 'is_route'));
         $associated_routes = Route::addBestSummitName($associated_routes, $this->__(' :') . ' ');
         $associated_docs = array_filter($this->associated_docs, array('c2cTools', 'is_not_route'));
         $associated_docs = array_filter($associated_docs, array('c2cTools', 'is_not_image'));
         $associated_docs = array_merge($associated_docs, $associated_routes);
         // sort by document type, name
         if (!empty($associated_docs)) {
             foreach ($associated_docs as $key => $row) {
                 $module[$key] = $row['module'];
                 $name[$key] = remove_accents($row['name']);
             }
             array_multisort($module, SORT_STRING, $name, SORT_STRING, $associated_docs);
         }
         $this->associated_documents = $associated_docs;
         // add linked docs areas (except users and images)
         $parent_ids = array();
         $associated_areas = array();
         foreach ($this->associated_docs as $doc) {
             if (!in_array($doc['module'], array('images', 'users'))) {
                 $parent_ids[] = $doc['id'];
             }
         }
         if (count($parent_ids)) {
             $prefered_cultures = $this->getUser()->getCulturesForDocuments();
             $associated_docs_areas = GeoAssociation::findAreasWithBestName($parent_ids, $prefered_cultures);
             $associated_areas = $this->associated_areas;
             $areas_ids = array();
             foreach ($associated_areas as $area) {
                 $areas_ids[] = $area['id'];
             }
             foreach ($associated_docs_areas as $area) {
                 if (!in_array($area['id'], $areas_ids)) {
                     $associated_areas[] = $area;
                 }
             }
         }
         $this->associated_areas = $associated_areas;
         $related_portals = array();
         $activities = $this->document->get('activities');
         if (in_array(5, $activities)) {
             $related_portals[] = 'ice';
         }
         Portal::getLocalPortals($related_portals, $associated_areas);
         $this->related_portals = $related_portals;
         // link for facebook
         list($image_name, $image_ext) = Images::getFileNameParts($this->document['filename']);
         $image_url = DIRECTORY_SEPARATOR . sfConfig::get('app_upload_dir') . DIRECTORY_SEPARATOR . sfConfig::get('app_images_directory_name') . DIRECTORY_SEPARATOR . $image_name . 'SI' . $image_ext;
         addMetaLink('image_src', $image_url);
     }
 }
示例#10
0
/**
 *  convert_cyr_string accentued letters, spaces, ... to a valid filename format
 */
function sanitize_name($string)
{
    // iconv needs locale install on server.
    // setlocale(LC_ALL, 'en_GB');
    // $sanitized = iconv('UTF-8', 'ASCII//TRANSLIT', $name);
    $sanitized = remove_accents($string);
    $sanitized = preg_replace("/[^a-zA-Z0-9]/", "_", $sanitized);
    return preg_replace("/_+/", "_", $sanitized);
}
 function slugify($text)
 {
     $text = remove_accents($text);
     $text = str_replace('&', 'y', $text);
     $text = preg_replace('/[^[a-z0-9]]*/si', '', $text);
     $text = preg_replace('/\\W+/', '', $text);
     $text = strtolower(trim($text, ''));
     return $text;
 }
示例#12
0
 /**
  * Slugifies string:
  * - Removes accents
  * - Converts everything to lowercase
  * - Replaces white spaces with a separator; default separator is underscore
  * 
  * @param  string $string  String to modify
  * @param  array  $options Slugification options
  * @return string          Slugified string
  */
 public static function slugify($string, $options = array("separator" => "_"))
 {
     // Remove any accented characters
     $string = \remove_accents($string);
     // Make it all lowercase
     $string = \strtolower($string);
     // Replace white spaces
     $string = \preg_replace("/ /", $options["separator"], $string);
     return $string;
 }
function wfu_upload_plugin_clean($label)
{
    $clean = sanitize_file_name($label);
    if (WFU_VAR("WFU_SANITIZE_FILENAME_MODE") != "loose") {
        $search = array('@[^a-zA-Z0-9._]@');
        $replace = array('-');
        $clean = preg_replace($search, $replace, remove_accents($clean));
    }
    return $clean;
}
示例#14
0
function hesk_cleanFileName($filename)
{
    $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "\$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", chr(0));
    /* ' */
    $filename = str_replace($special_chars, '', $filename);
    $filename = preg_replace('/[\\s-]+/', '-', $filename);
    $filename = trim($filename, '.-_');
    $filename = remove_accents($filename);
    return $filename;
}
示例#15
0
文件: pdf.php 项目: kidaa30/Swevers
 public function save_to($filename = false)
 {
     if ($this->snappy) {
         if (!$filename) {
             $site = current_site();
             $filename = strtolower(preg_replace('/\\s+/is', '-', trim(preg_replace('/[^a-z0-9\\s]/is', '', remove_accents($site['name']))))) . '.pdf';
         }
         $this->snappy->generateFromHtml($this->html, $filename, $this->options, true);
     }
 }
示例#16
0
 public static function generateSlug($str)
 {
     $str = remove_accents($str);
     $str = strtolower(trim($str));
     $str = preg_replace('/[^a-z0-9-]/', '-', $str);
     $str = preg_replace('/-+/', "-", $str);
     if (substr($str, strlen($str) - 1, strlen($str)) == "-") {
         $str = substr($str, 0, strlen($str) - 1);
     }
     return $str;
 }
 /**
  * Register endpoint
  *
  * @param string                 $rewrite_path
  * @param string|Server\Endpoint $endpoint_class
  */
 public function register_endpoint($rewrite_path, $endpoint_class)
 {
     // Normalize rewrite path
     $rewrite_path = trim($rewrite_path, '/');
     if (!is_object($endpoint_class)) {
         // Sanitize class name
         $endpoint_class = remove_accents($endpoint_class);
         $endpoint_class = preg_replace('/[^a-zA-Z0-9_]/', '', $endpoint_class);
     }
     $this->endpoints[$rewrite_path] = $endpoint_class;
 }
示例#18
0
function qtranxf_useRawTitle($title, $raw_title = '', $context = 'save')
{
    if ($raw_title == '') {
        $raw_title = $title;
    }
    if ('save' == $context) {
        $raw_title = qtranxf_useDefaultLanguage($raw_title);
        $title = remove_accents($raw_title);
    }
    return $title;
}
示例#19
0
function _cw_sanitize_filename($filename)
{
    //Invalid characters
    $invalid = array('À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä€' => 'A', 'Ä‚' => 'A', 'Ȧ' => 'A', 'Ä' => 'A', 'Ả' => 'A', 'Ã…' => 'A', 'Ǎ' => 'A', 'È€' => 'A', 'È‚' => 'A', 'Ä„' => 'A', 'Ạ' => 'A', 'Ḁ' => 'A', 'Ầ' => 'A', 'Ấ' => 'A', 'Ẫ' => 'A', 'Ẩ' => 'A', 'Ằ' => 'A', 'Ắ' => 'A', 'Ẵ' => 'A', 'Ẳ' => 'A', 'Ç ' => 'A', 'Çž' => 'A', 'Ǻ' => 'A', 'Ậ' => 'A', 'Ặ' => 'A', 'Æ' => 'AE', 'Ǽ' => 'AE', 'Ç¢' => 'AE', 'Ḃ' => 'B', 'Ɓ' => 'B', 'Ḅ' => 'B', 'Ḇ' => 'B', 'Æ‚' => 'B', 'Æ„' => 'B', 'Þ' => 'B', 'Ĉ' => 'C', 'ÄŠ' => 'C', 'ÄŒ' => 'C', 'Ƈ' => 'C', 'Ç' => 'C', 'Ḉ' => 'C', 'Ḋ' => 'D', 'ÆŠ' => 'D', 'Ḍ' => 'D', 'Ḏ' => 'D', 'Ḑ' => 'D', 'Ḓ' => 'D', 'ÄŽ' => 'D', 'Đ' => 'Dj', 'Ɖ' => 'Dj', 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ẽ' => 'E', 'Ä’' => 'E', 'Ä”' => 'E', 'Ä–' => 'E', 'Ë' => 'E', 'Ẻ' => 'E', 'Äš' => 'E', 'È„' => 'E', 'Ȇ' => 'E', 'Ẹ' => 'E', 'Ȩ' => 'E', 'Ę' => 'E', 'Ḙ' => 'E', 'Ḛ' => 'E', 'Ề' => 'E', 'Ế' => 'E', 'Ễ' => 'E', 'Ể' => 'E', 'Ḕ' => 'E', 'Ḗ' => 'E', 'Ệ' => 'E', 'Ḝ' => 'E', 'ÆŽ' => 'E', 'Ɛ' => 'E', 'Ḟ' => 'F', 'Æ‘' => 'F', 'Ç´' => 'G', 'Äœ' => 'G', 'Ḡ' => 'G', 'Äž' => 'G', 'Ä ' => 'G', 'Ǧ' => 'G', 'Æ“' => 'G', 'Ä¢' => 'G', 'Ǥ' => 'G', 'Ĥ' => 'H', 'Ḧ' => 'H', 'Èž' => 'H', 'Ƕ' => 'H', 'Ḥ' => 'H', 'Ḩ' => 'H', 'Ḫ' => 'H', 'Ħ' => 'H', 'ÃŒ' => 'I', 'Í' => 'I', 'ÃŽ' => 'I', 'Ĩ' => 'I', 'Ī' => 'I', 'Ĭ' => 'I', 'Ä°' => 'I', 'Ï' => 'I', 'Ỉ' => 'I', 'Ǐ' => 'I', 'Ị' => 'I', 'Ä®' => 'I', 'Ȉ' => 'I', 'ÈŠ' => 'I', 'Ḭ' => 'I', 'Æ—' => 'I', 'Ḯ' => 'I', 'IJ' => 'IJ', 'Ä´' => 'J', 'Ḱ' => 'K', 'Ǩ' => 'K', 'Ḵ' => 'K', 'Ƙ' => 'K', 'Ḳ' => 'K', 'Ķ' => 'K', 'Ĺ' => 'L', 'Ḻ' => 'L', 'Ḷ' => 'L', 'Ä»' => 'L', 'Ḽ' => 'L', 'Ľ' => 'L', 'Ä¿' => 'L', 'Ł' => 'L', 'Ḹ' => 'L', 'Ḿ' => 'M', 'á¹€' => 'M', 'Ṃ' => 'M', 'Æœ' => 'M', 'Ñ' => 'N', 'Ǹ' => 'N', 'Ń' => 'N', 'Ñ' => 'N', 'Ṅ' => 'N', 'Ň' => 'N', 'ÅŠ' => 'N', 'Ɲ' => 'N', 'Ṇ' => 'N', 'Å…' => 'N', 'Ṋ' => 'N', 'Ṉ' => 'N', 'È ' => 'N', 'Ã’' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'ÅŒ' => 'O', 'ÅŽ' => 'O', 'È®' => 'O', 'Ö' => 'O', 'Ỏ' => 'O', 'Ő' => 'O', 'Ç‘' => 'O', 'ÈŒ' => 'O', 'ÈŽ' => 'O', 'Æ ' => 'O', 'Ǫ' => 'O', 'Ọ' => 'O', 'ÆŸ' => 'O', 'Ø' => 'O', 'á»’' => 'O', 'Ố' => 'O', 'á»–' => 'O', 'á»”' => 'O', 'È°' => 'O', 'Ȫ' => 'O', 'Ȭ' => 'O', 'Ṍ' => 'O', 'Ṑ' => 'O', 'á¹’' => 'O', 'Ờ' => 'O', 'Ớ' => 'O', 'á» ' => 'O', 'Ở' => 'O', 'Ợ' => 'O', 'Ǭ' => 'O', 'Ộ' => 'O', 'Ǿ' => 'O', 'Ɔ' => 'O', 'Å’' => 'OE', 'á¹”' => 'P', 'á¹–' => 'P', 'Ƥ' => 'P', 'Å”' => 'R', 'Ṙ' => 'R', 'Ř' => 'R', 'Ȑ' => 'R', 'È’' => 'R', 'Ṛ' => 'R', 'Å–' => 'R', 'Ṟ' => 'R', 'Ṝ' => 'R', 'Ʀ' => 'R', 'Åš' => 'S', 'Åœ' => 'S', 'á¹ ' => 'S', 'Å ' => 'S', 'á¹¢' => 'S', 'Ș' => 'S', 'Åž' => 'S', 'Ṥ' => 'S', 'Ṧ' => 'S', 'Ṩ' => 'S', 'Ṫ' => 'T', 'Ť' => 'T', 'Ƭ' => 'T', 'Æ®' => 'T', 'Ṭ' => 'T', 'Èš' => 'T', 'Å¢' => 'T', 'á¹°' => 'T', 'á¹®' => 'T', 'Ŧ' => 'T', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ũ' => 'U', 'Ū' => 'U', 'Ŭ' => 'U', 'Ãœ' => 'U', 'Ủ' => 'U', 'Å®' => 'U', 'Å°' => 'U', 'Ç“' => 'U', 'È”' => 'U', 'È–' => 'U', 'Ư' => 'U', 'Ụ' => 'U', 'á¹²' => 'U', 'Ų' => 'U', 'Ṷ' => 'U', 'á¹´' => 'U', 'Ṹ' => 'U', 'Ṻ' => 'U', 'Ç›' => 'U', 'Ç—' => 'U', 'Ç•' => 'U', 'Ç™' => 'U', 'Ừ' => 'U', 'Ứ' => 'U', 'á»®' => 'U', 'Ử' => 'U', 'á»°' => 'U', 'á¹¼' => 'V', 'á¹¾' => 'V', 'Ʋ' => 'V', 'Ẁ' => 'W', 'Ẃ' => 'W', 'Å´' => 'W', 'Ẇ' => 'W', 'Ẅ' => 'W', 'Ẉ' => 'W', 'Ẋ' => 'X', 'Ẍ' => 'X', 'Ỳ' => 'Y', 'Ý' => 'Y', 'Ŷ' => 'Y', 'Ỹ' => 'Y', 'Ȳ' => 'Y', 'Ẏ' => 'Y', 'Ÿ' => 'Y', 'Ỷ' => 'Y', 'Ƴ' => 'Y', 'á»´' => 'Y', 'Ź' => 'Z', 'Ẑ' => 'Z', 'Å»' => 'Z', 'Ž' => 'Z', 'Ȥ' => 'Z', 'Ẓ' => 'Z', 'Ẕ' => 'Z', 'Ƶ' => 'Z', 'à ' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ā' => 'a', 'ă' => 'a', 'ȧ' => 'a', 'ä' => 'a', 'ả' => 'a', 'Ã¥' => 'a', 'ÇŽ' => 'a', 'ȁ' => 'a', 'Ä…' => 'a', 'ạ' => 'a', 'ḁ' => 'a', 'ẚ' => 'a', 'ầ' => 'a', 'ấ' => 'a', 'ẫ' => 'a', 'ẩ' => 'a', 'ằ' => 'a', 'ắ' => 'a', 'ẵ' => 'a', 'ẳ' => 'a', 'Ç¡' => 'a', 'ÇŸ' => 'a', 'Ç»' => 'a', 'ậ' => 'a', 'ặ' => 'a', 'æ' => 'ae', 'ǽ' => 'ae', 'Ç£' => 'ae', 'ḃ' => 'b', 'É“' => 'b', 'ḅ' => 'b', 'ḇ' => 'b', 'Æ€' => 'b', 'ƃ' => 'b', 'Æ…' => 'b', 'þ' => 'b', 'ć' => 'c', 'ĉ' => 'c', 'Ä‹' => 'c', 'č' => 'c', 'ƈ' => 'c', 'ç' => 'c', 'ḉ' => 'c', 'ḋ' => 'd', 'É—' => 'd', 'ḍ' => 'd', 'ḏ' => 'd', 'ḑ' => 'd', 'ḓ' => 'd', 'ď' => 'd', 'Ä‘' => 'd', 'ÆŒ' => 'd', 'È¡' => 'd', 'Ä‘' => 'dj', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ẽ' => 'e', 'Ä“' => 'e', 'Ä•' => 'e', 'Ä—' => 'e', 'ë' => 'e', 'ẻ' => 'e', 'Ä›' => 'e', 'È…' => 'e', 'ȇ' => 'e', 'ẹ' => 'e', 'È©' => 'e', 'Ä™' => 'e', 'ḙ' => 'e', 'ḛ' => 'e', 'ề' => 'e', 'ế' => 'e', 'á»…' => 'e', 'ể' => 'e', 'ḕ' => 'e', 'ḗ' => 'e', 'ệ' => 'e', 'ḝ' => 'e', 'ǝ' => 'e', 'É›' => 'e', 'ḟ' => 'f', 'Æ’' => 'f', 'ǵ' => 'g', 'ĝ' => 'g', 'ḡ' => 'g', 'ÄŸ' => 'g', 'Ä¡' => 'g', 'ǧ' => 'g', 'É ' => 'g', 'Ä£' => 'g', 'Ç¥' => 'g', 'Ä¥' => 'h', 'ḣ' => 'h', 'ḧ' => 'h', 'ÈŸ' => 'h', 'Æ•' => 'h', 'ḥ' => 'h', 'ḩ' => 'h', 'ḫ' => 'h', 'ẖ' => 'h', 'ħ' => 'h', 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'Ä©' => 'i', 'Ä«' => 'i', 'Ä­' => 'i', 'ı' => 'i', 'ï' => 'i', 'ỉ' => 'i', 'ǐ' => 'i', 'ị' => 'i', 'į' => 'i', 'ȉ' => 'i', 'È‹' => 'i', 'ḭ' => 'i', 'ɨ' => 'i', 'ḯ' => 'i', 'ij' => 'ij', 'ĵ' => 'j', 'Ç°' => 'j', 'ḱ' => 'k', 'Ç©' => 'k', 'ḵ' => 'k', 'Æ™' => 'k', 'ḳ' => 'k', 'Ä·' => 'k', 'ĺ' => 'l', 'ḻ' => 'l', 'ḷ' => 'l', 'ļ' => 'l', 'ḽ' => 'l', 'ľ' => 'l', 'Å€' => 'l', 'Å‚' => 'l', 'Æš' => 'l', 'ḹ' => 'l', 'È´' => 'l', 'ḿ' => 'm', 'ṁ' => 'm', 'ṃ' => 'm', 'ɯ' => 'm', 'ǹ' => 'n', 'Å„' => 'n', 'ñ' => 'n', 'á¹…' => 'n', 'ň' => 'n', 'Å‹' => 'n', 'ɲ' => 'n', 'ṇ' => 'n', 'ņ' => 'n', 'ṋ' => 'n', 'ṉ' => 'n', 'ʼn' => 'n', 'Æž' => 'n', 'ȵ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ō' => 'o', 'ŏ' => 'o', 'ȯ' => 'o', 'ö' => 'o', 'ỏ' => 'o', 'Å‘' => 'o', 'Ç’' => 'o', 'ȍ' => 'o', 'ȏ' => 'o', 'Æ¡' => 'o', 'Ç«' => 'o', 'ọ' => 'o', 'ɵ' => 'o', 'ø' => 'o', 'ồ' => 'o', 'ố' => 'o', 'á»—' => 'o', 'ổ' => 'o', 'ȱ' => 'o', 'È«' => 'o', 'È­' => 'o', 'ṍ' => 'o', 'ṏ' => 'o', 'ṑ' => 'o', 'ṓ' => 'o', 'ờ' => 'o', 'á»›' => 'o', 'ỡ' => 'o', 'ở' => 'o', 'ợ' => 'o', 'Ç­' => 'o', 'á»™' => 'o', 'Ç¿' => 'o', 'É”' => 'o', 'Å“' => 'oe', 'ṕ' => 'p', 'á¹—' => 'p', 'Æ¥' => 'p', 'Å•' => 'r', 'á¹™' => 'r', 'Å™' => 'r', 'È‘' => 'r', 'È“' => 'r', 'á¹›' => 'r', 'Å—' => 'r', 'ṟ' => 'r', 'ṝ' => 'r', 'Å›' => 's', 'ŝ' => 's', 'ṡ' => 's', 'Å¡' => 's', 'á¹£' => 's', 'È™' => 's', 'ÅŸ' => 's', 'á¹¥' => 's', 'ṧ' => 's', 'ṩ' => 's', 'Å¿' => 's', 'ẛ' => 's', 'ß' => 'Ss', 'ṫ' => 't', 'ẗ' => 't', 'Å¥' => 't', 'Æ­' => 't', 'ʈ' => 't', 'Æ«' => 't', 'á¹­' => 't', 'È›' => 't', 'Å£' => 't', 'á¹±' => 't', 'ṯ' => 't', 'ŧ' => 't', 'ȶ' => 't', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'Å©' => 'u', 'Å«' => 'u', 'Å­' => 'u', 'ü' => 'u', 'ủ' => 'u', 'ů' => 'u', 'ű' => 'u', 'Ç”' => 'u', 'È•' => 'u', 'È—' => 'u', 'Æ°' => 'u', 'ụ' => 'u', 'á¹³' => 'u', 'ų' => 'u', 'á¹·' => 'u', 'á¹µ' => 'u', 'á¹¹' => 'u', 'á¹»' => 'u', 'Çœ' => 'u', 'ǘ' => 'u', 'Ç–' => 'u', 'Çš' => 'u', 'ừ' => 'u', 'ứ' => 'u', 'ữ' => 'u', 'á»­' => 'u', 'á»±' => 'u', 'á¹½' => 'v', 'ṿ' => 'v', 'ẁ' => 'w', 'ẃ' => 'w', 'ŵ' => 'w', 'ẇ' => 'w', 'ẅ' => 'w', 'ẘ' => 'w', 'ẉ' => 'w', 'ẋ' => 'x', 'ẍ' => 'x', 'ý' => 'y', 'ý' => 'y', 'ỳ' => 'y', 'ý' => 'y', 'Å·' => 'y', 'ȳ' => 'y', 'ẏ' => 'y', 'ÿ' => 'y', 'ÿ' => 'y', 'á»·' => 'y', 'ẙ' => 'y', 'Æ´' => 'y', 'ỵ' => 'y', 'ź' => 'z', 'ẑ' => 'z', 'ż' => 'z', 'ž' => 'z', 'È¥' => 'z', 'ẓ' => 'z', 'ẕ' => 'z', 'ƶ' => 'z', 'â„–' => 'No', 'º' => 'o', 'ª' => 'a', '€' => 'E', '©' => 'C', 'â„—' => 'P', 'â„¢' => 'tm', 'â„ ' => 'sm');
    //Make the magic
    $sanitized_filename = str_replace(array_keys($invalid), array_values($invalid), $filename);
    $sanitized_filename = remove_accents($sanitized_filename);
    $sanitized_filename = preg_replace('/[^a-zA-Z0-9-_\\.]/', '', strtolower($sanitized_filename));
    //Return the new name
    return $sanitized_filename;
}
/**
 * Sanitize taxonomy names. Slug format (no spaces, lowercase).
 *
 * Doesn't use sanitize_title as this destroys utf chars.
 *
 * @access public
 * @param mixed $taxonomy
 * @return string
 */
function sp_sanitize_taxonomy_name($taxonomy)
{
    $filtered = strtolower(remove_accents(stripslashes(strip_tags($taxonomy))));
    $filtered = preg_replace('/&.+?;/', '', $filtered);
    // Kill entities
    $filtered = str_replace(array('.', '\'', '"'), '', $filtered);
    // Kill quotes and full stops.
    $filtered = str_replace(array(' ', '_'), '-', $filtered);
    // Replace spaces and underscores.
    return apply_filters('sanitize_taxonomy_name', $filtered, $taxonomy);
}
示例#21
0
/**
 * Sanitize Module Key
 *
 * @param $key
 *
 * @return mixed|string
 */
function rtbiz_sanitize_module_key($key)
{
    $filtered = strtolower(remove_accents(stripslashes(strip_tags($key))));
    $filtered = preg_replace('/&.+?;/', '', $filtered);
    // Kill entities
    $filtered = str_replace(array('.', '\'', '"'), '', $filtered);
    // Kill quotes and full stops.
    $filtered = str_replace(array(' '), '-', $filtered);
    // Replace spaces.
    return $filtered;
}
示例#22
0
function filter_slug($title, $raw_title = NULL, $context = 'query')
{
    if ($raw_title != NULL) {
        $title = $raw_title;
    }
    $title = tool_sanitize_urlstring($title);
    if ($context == 'save') {
        $title = remove_accents($title);
    }
    return $title;
}
示例#23
0
function renamefilestrict($filetorename)
{
    // strict rename policy (just characters from a to z and numbers... no accents and other characters). This kind of renaming can have problems with some languages (e.g. oriental)
    $filetorename = remove_accents($filetorename);
    $filetorename = strtolower($filetorename);
    $filetorename = str_replace(array(' ', '.', ',', 'amp'), "_", $filetorename);
    //amp is the remaining string from &amp;
    // \w matches alphanumeric characters and underscores + dash added
    $filetorename = preg_replace("/[^\\w-]/", "", $filetorename);
    return $filetorename;
}
示例#24
0
function sanitize_title($title, $fallback_title = '', $context = 'save')
{
    $raw_title = $title;
    $title = sanitize_title_with_accented($title, $raw_title);
    if ('save' == $context) {
        $title = remove_accents($title);
    }
    if ('' === $title || false === $title) {
        $title = $fallback_title;
    }
    return $title;
}
 /**
  * @ticket 20772
  */
 public function test_remove_accents_hanyu_pinyin()
 {
     // Vowels with diacritic (Chinese, Hanyu Pinyin)
     // macron
     $this->assertEquals('aeiouuAEIOUU', remove_accents('āēīōūǖĀĒĪŌŪǕ'));
     // acute accent
     $this->assertEquals('aeiouuAEIOUU', remove_accents('áéíóúǘÁÉÍÓÚǗ'));
     // caron
     $this->assertEquals('aeiouuAEIOUU', remove_accents('ǎěǐǒǔǚǍĚǏǑǓǙ'));
     // grave accent
     $this->assertEquals('aeiouuAEIOUU', remove_accents('àèìòùǜÀÈÌÒÙǛ'));
     // unmarked
     $this->assertEquals('aaeiouuAEIOUU', remove_accents('aɑeiouüAEIOUÜ'));
 }
function show_lightbox($option = 'gfullmap_options')
{
    $fgm_glightbox_height = null;
    $fgm_glightbox_width = null;
    $fgm_glightbox_map_type = null;
    $fgm_glightbox_add = null;
    $fgm_glightbox_zoom = null;
    $options = get_option($option);
    $lout = '';
    if (!isset($options['glightbox_bubble'])) {
        $options['glightbox_bubble'] = 0;
    }
    if ($options['glightbox_bubble']) {
        $iwloc = 'addr';
    } else {
        $iwloc = 'near';
    }
    if (array_key_exists("glightbox_height", $options)) {
        $fgm_glightbox_height = $options['glightbox_height'];
    }
    if (array_key_exists("glightbox_map_type", $options)) {
        $fgm_glightbox_map_type = $options['glightbox_map_type'];
    }
    if (array_key_exists("glightbox_width", $options)) {
        $fgm_glightbox_width = $options['glightbox_width'];
    }
    if (array_key_exists("g_thumb_address", $options)) {
        $fgm_glightbox_add = $options['g_thumb_address'];
    }
    if (array_key_exists("glightbox_zoom_val", $options)) {
        $fgm_glightbox_zoom = $options['glightbox_zoom_val'];
    }
    if (array_key_exists("g_thumb_address", $options) && $options['g_thumb_address'] == null) {
        $options['g_thumb_address'] = 'New York, USA';
        $fgm_glightbox_add = $options['g_thumb_address'];
    }
    if ($fgm_glightbox_height == null) {
        $fgm_glightbox_height = '500';
    }
    if ($fgm_glightbox_width == null) {
        $fgm_glightbox_width = '500';
    }
    $from_this = "http://www.wpfruits.com/?fwgm_refs=" . $_SERVER['SERVER_NAME'];
    $map_url = 'http://maps.google.com/maps?hl=en&amp;ie=utf8&amp;output=embed&amp;iwloc=' . $iwloc . '&amp;iwd=1&amp;mrt=loc&amp;t=' . $fgm_glightbox_map_type . '&amp;q=' . urlencode(remove_accents($fgm_glightbox_add)) . '&amp;z=' . urlencode($fgm_glightbox_zoom) . '';
    $lout .= '<div class="gmbdm-dialog"  data-map-height="' . $fgm_glightbox_height . '" gmaptype="' . $fgm_glightbox_map_type . '" data-map-width="' . $fgm_glightbox_width . '" data-map-skin="black-square" data-map-iframe-url="' . $map_url . '" id="dialog-lightgmap-' . $option . '" title="Google Map">';
    $lout .= '<div class="createPopup gmbdm-map createPopup-' . $option . '" style="overflow: auto;"><div class="innerdiv" style="border:10px solid #000000; z-index:999999999;position:relative; margin:auto; display:block; height:' . ($fgm_glightbox_height + 20) . 'px; width:' . $fgm_glightbox_width . 'px;"><div class="cf-close"></div><iframe  height=' . $fgm_glightbox_height . 'px width=' . $fgm_glightbox_width . 'px src="' . $map_url . '"></iframe></div></div>';
    $lout .= '</div>';
    echo $lout;
}
示例#27
0
function qtranxf_useRawTitle($title, $raw_title = '', $context = 'save')
{
    switch ($context) {
        case 'save':
            if (empty($raw_title)) {
                $raw_title = $title;
            }
            $raw_title = qtranxf_useDefaultLanguage($raw_title);
            $title = remove_accents($raw_title);
            break;
        default:
            break;
    }
    return $title;
}
示例#28
0
function build_authors_group($group)
{
    $html = '';
    foreach ($group as $author) {
        $html .= '<div class="author-section">';
        $html .= '<div class="author-img m-all t-1of3 d-1of3 ld-1of4">' . wp_get_attachment_image($author['img'], 'moebius-square') . '</div>';
        $html .= '<div class="author-info m-all t-2of3 d-2of3 ld-3of4">';
        $html .= '<h3 class="author-name"><a href="/?s=' . urlencode(remove_accents($author['name'])) . '">' . $author['name'] . '</a></h3>';
        $html .= '<p class="author-role">' . $author['role_title'] . '</p>';
        $html .= '<div class="author-bio">' . apply_filters('the_content', $author['bio']) . '</div>';
        $html .= '</div>';
        $html .= '</div>';
    }
    return $html;
}
示例#29
0
 public static function findLatLong($address, $country)
 {
     //	$prepAddr=LatLong::removeAccents($address. " ".$country);
     //	$prepAddr = urlencode(str_replace(' ','+',$prepAddr));
     //echo "p".$prepAddr. " a ". ($address. " ".$country);
     $prepAddr = remove_accents($address . " " . $country);
     $prepAddr = urlencode(str_replace(' ', '+', $prepAddr));
     //$geocode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$prepAddr.'&sensor=false');
     $geocode = file_get_contents('http://maps.google.com/maps/api/geocode/json?address=' . $prepAddr . '&sensor=false');
     echo 'http://maps.google.com/maps/api/geocode/json?address=' . $prepAddr . '&sensor=false';
     $output = json_decode($geocode);
     //print_r($output);
     $instance = new self($output->results[0]->geometry->location->lat, $output->results[0]->geometry->location->lng);
     return $instance;
 }
示例#30
0
function SEO($text, $slash = false)
{
    $text = preg_replace('/ \\&\\#?[(0-9a-zA-Z){4}]+\\;/', '', $text);
    $text = remove_accents($text);
    $text = rus2translit($text);
    $entities_match = array('&quot;', '!', '@', '#', '%', '^', '&', '*', '_', '(', ')', '+', '{', '}', '|', ':', '"', '<', '>', '?', '[', ']', '\\', ';', '"', ',', '.', '/', '*', '+', '~', '`', '=', "'");
    $entities_replace = array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
    $clean_text = str_replace($entities_match, $entities_replace, $text);
    $clean_text = trim($clean_text);
    $clean_text = preg_replace('/ /', '-', $clean_text);
    if ($clean_text != '') {
        $slash = $slash ? '/' : NULL;
    }
    $clean_text = preg_replace('/\\-{2,10}/', '-', $clean_text);
    return $slash . $clean_text;
}