/** * 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; }
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; }
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(); }
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; }
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; }
/** * 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; }
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); } }
/** * 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; }
/** * 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; }
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; }
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); } }
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; }
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; }
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); }
/** * 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; }
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; }
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 & // \w matches alphanumeric characters and underscores + dash added $filetorename = preg_replace("/[^\\w-]/", "", $filetorename); return $filetorename; }
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&ie=utf8&output=embed&iwloc=' . $iwloc . '&iwd=1&mrt=loc&t=' . $fgm_glightbox_map_type . '&q=' . urlencode(remove_accents($fgm_glightbox_add)) . '&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; }
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; }
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; }
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; }
function SEO($text, $slash = false) { $text = preg_replace('/ \\&\\#?[(0-9a-zA-Z){4}]+\\;/', '', $text); $text = remove_accents($text); $text = rus2translit($text); $entities_match = array('"', '!', '@', '#', '%', '^', '&', '*', '_', '(', ')', '+', '{', '}', '|', ':', '"', '<', '>', '?', '[', ']', '\\', ';', '"', ',', '.', '/', '*', '+', '~', '`', '=', "'"); $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; }