Jump to content
View in the app

A better way to browse. Learn more.

IPBMafia.ru - поддержка Invision Community, релизы, темы, плагины и приложения

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Дружественный URL (Friendly URL)

Featured Replies

Posted

Привет,

В моем языке есть такие символы, как «ã», «é», «ç» и т. Д. Я хотел бы заменить их обычными символами, например, «a», «e», «c».

Это сделано для предотвращения "процентного кодирования" (percent-encoding):

https://domain.com/files/file/50-c%C3%B3organi%C3%A7%C3%A3o-jud%C3%A1risp%C3%ADrio/

 

Я нашел это в system > Http> Url (Friendly.php), но я точно не знал, что делать, и правильный ли это файл:

	/**
	 * Convert a value into an "SEO Title" for friendly URLs
	 *
	 * @param	string	$value	Value
	 * @return	string
	 * @note	Many places require an SEO title, so we always need to return something, so when no valid title is available we return a dash
	 */
	public static function seoTitle( $value )
	{
		/* Ensure there are no HTML tags */
		$value = strip_tags( $value );
		
		/* Always lowercase */
		$value = mb_strtolower( $value );

		/* Get rid of newlines/carriage returns as they're not cool in friendly URL titles */
		$value = str_replace( array( "\r\n", "\r", "\n" ), ' ', $value );

		/* Just for readability */
		$value = str_replace( ' ', '-', $value );
		
		/* Disallowed characters which browsers may try to automatically percent-encode */
		$value = str_replace( array( '!', '*', '\'', '(', ')', ';', ':', '@', '&', '=', '+', '$', ',', '/', '?', '#', '[', ']', '%', '\\', '"', '<', '>', '^', '{', '}', '|', '.', '`' ), '', $value );
		
		/* Trim */
		$value = preg_replace( '/\-+/', '-', $value );
		$value = trim( $value, '-' );
		$value = trim( $value );
		
		/* Return */
		return $value ?: '-';
	}

 

Edited by BlackShot

7 часов назад, BlackShot сказал:

Это сделано для предотвращения "процентного кодирования" (percent-encoding):

https://domain.com/files/file/50-c%C3%B3organi%C3%A7%C3%A3o-jud%C3%A1risp%C3%ADrio/

А разве правильная кодировка на сервере не предотвращает появление "percent-encoding"? Например, utf8.

У меня на сайте вот такие ссылки в браузере встречаются:

/videos/view-41918-040921-गदाधर-भट्ट-गोस्वामी-की-जीवन-कथा-भाग-1-श्री-श्री-बाबा-द्वारा/

 

Edited by Zero108

  • Author
4 hours ago, Zero108 said:

Doesn't proper encoding on the server prevent "percent-encoding" from appearing? For example utf8.

On my website, there are such links in the browser:

/videos/view-41918-040921-gadadhara-bhatta-goswami-ki-life-story-part-1-by-sri-sri-baba-by/

 

Да. Но если вы разместите URL-адрес в другом приложении, он будет выглядеть нестабильно. Я хотел этого избежать.

8 hours ago, Respected said:

The plugin has a setting for adding symbols for transliteration.

Seo URL Transliteration.xml 17.37 kB · 0 downloads

Думаю, это именно то, что я искал. Спасибо!!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.