Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/YOURLS/YOURLS.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorozhozh <ozhozh@12232710-3e20-11de-b438-597f59cd7555>2010-06-14 20:26:29 +0400
committerozhozh <ozhozh@12232710-3e20-11de-b438-597f59cd7555>2010-06-14 20:26:29 +0400
commitecdef9a9ca4045b19e8e2ec23fcf327c303a5a85 (patch)
tree5e5b7ebc3d92e2d3471f85a5d0e28ff512252c2e /yourls-loader.php
parent800f72edfca4ab5088b6c47d4a74bf2488e57055 (diff)
First attempt at http://sho.rt/http://site/ rewrite rule (most likely will fail on Windows)
git-svn-id: http://yourls.googlecode.com/svn/trunk@397 12232710-3e20-11de-b438-597f59cd7555
Diffstat (limited to 'yourls-loader.php')
-rw-r--r--yourls-loader.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/yourls-loader.php b/yourls-loader.php
index e187fcb4..be0e05b4 100644
--- a/yourls-loader.php
+++ b/yourls-loader.php
@@ -23,20 +23,29 @@ yourls_do_action( 'pre_load_template', $request );
// At this point, $request is not sanitized. Sanitize in loaded template.
// Redirection:
-if( preg_match( "/^([$pattern]+)\/?$/", $request, $matches ) ) {
+if( preg_match( "@^([$pattern]+)/?$@", $request, $matches ) ) {
$keyword = isset( $matches[1] ) ? $matches[1] : '';
include( YOURLS_ABSPATH.'/yourls-go.php' );
exit;
}
// Stats:
-if( preg_match( "/^([$pattern]+)\+(all)?\/?$/", $request, $matches ) ) {
+if( preg_match( "@^([$pattern]+)\+(all)?/?$@", $request, $matches ) ) {
$keyword = isset( $matches[1] ) ? $matches[1] : '';
$aggregate = isset( $matches[2] ) ? (bool)$matches[2] && yourls_allow_duplicate_longurls() : false;
include( YOURLS_ABSPATH.'/yourls-infos.php' );
exit;
}
+/** Check this on Linux. Cannot run on Windows, see https://issues.apache.org/bugzilla/show_bug.cgi?id=41441
+// Bookmarklet:
+if( preg_match( "@^[a-zA-Z]://.+@", $request, $matches ) ) {
+ $url = $matches[0];
+ yourls_redirect( yourls_admin_url('index.php').'?u='.rawurlencode( $url ) );
+ exit;
+}
+/**/
+
// Past this point this is a request the loader could not understand
yourls_do_action( 'loader_failed', $request );
yourls_redirect( YOURLS_SITE, 307 );