aboutsummaryrefslogtreecommitdiff
path: root/user/plugins/hyphens-in-urls
diff options
context:
space:
mode:
authors1n <[email protected]>2020-03-28 10:36:41 -0700
committers1n <[email protected]>2020-03-28 10:36:41 -0700
commit25b7d2aab61ae6421398d3abae5da6ffe590333d (patch)
tree611985ec78bb2d94099c9fd5dd687f5c9cee6f3e /user/plugins/hyphens-in-urls
parentInitial commit (diff)
downloadcrack.cf-backup-master.tar.xz
crack.cf-backup-master.zip
3/28/2020, 10:36HEADmaster
Diffstat (limited to 'user/plugins/hyphens-in-urls')
-rw-r--r--user/plugins/hyphens-in-urls/README.md6
-rw-r--r--user/plugins/hyphens-in-urls/plugin.php19
2 files changed, 25 insertions, 0 deletions
diff --git a/user/plugins/hyphens-in-urls/README.md b/user/plugins/hyphens-in-urls/README.md
new file mode 100644
index 0000000..ba72883
--- /dev/null
+++ b/user/plugins/hyphens-in-urls/README.md
@@ -0,0 +1,6 @@
+Hyphens in URLs
+===============
+This is a core plugin, bundled with YOURLS.
+Don't modify this plugin. Instead, copy its folder
+and modify your own copy. This way, your code won't
+be overwritten when you upgrade YOURLS. \ No newline at end of file
diff --git a/user/plugins/hyphens-in-urls/plugin.php b/user/plugins/hyphens-in-urls/plugin.php
new file mode 100644
index 0000000..3803412
--- /dev/null
+++ b/user/plugins/hyphens-in-urls/plugin.php
@@ -0,0 +1,19 @@
+<?php
+/*
+Plugin Name: Allow Hyphens in Short URLs
+Plugin URI: http://yourls.org/
+Description: Allow hyphens in short URLs (like <tt>http://sho.rt/hello-world</tt>)
+Version: 1.0
+Author: Ozh
+Author URI: http://ozh.org/
+*/
+
+// No direct call
+if( !defined( 'YOURLS_ABSPATH' ) ) die();
+
+yourls_add_filter( 'get_shorturl_charset', 'ozh_hyphen_in_charset' );
+function ozh_hyphen_in_charset( $in ) {
+ return $in.'-';
+}
+
+