From dea5876cbdc64d8a919401b75d6f1a14ff31f063 Mon Sep 17 00:00:00 2001 From: real_nowhereman Date: Tue, 6 Nov 2007 21:26:14 +0000 Subject: [PATCH] Several fixes - I hope - to prettyurls, still some issues on some servers, need to investigate this DIRNAME/ to DIRNAME.php --- fp-plugins/prettyurls/lang/lang.en-us.php | 4 ++-- fp-plugins/prettyurls/plugin.prettyurls.php | 11 ++++++----- .../prettyurls/tpls/admin.plugin.prettyurls.tpl | 6 ++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/fp-plugins/prettyurls/lang/lang.en-us.php b/fp-plugins/prettyurls/lang/lang.en-us.php index de017af..4fab0d0 100644 --- a/fp-plugins/prettyurls/lang/lang.en-us.php +++ b/fp-plugins/prettyurls/lang/lang.en-us.php @@ -13,8 +13,8 @@ 'submit' => 'Save' ); $lang['admin']['plugin']['prettyurls']['msgs'] = array( - 1 => 'API key saved', - -1 => 'API key is not valid' + 1 => '.htaccess saved successfully', + -1 => '.htaccess could not be saved (do you have writing permissions on '. BLOG_ROOT .')?' ); ?> \ No newline at end of file diff --git a/fp-plugins/prettyurls/plugin.prettyurls.php b/fp-plugins/prettyurls/plugin.prettyurls.php index f87e256..0ec22a7 100644 --- a/fp-plugins/prettyurls/plugin.prettyurls.php +++ b/fp-plugins/prettyurls/plugin.prettyurls.php @@ -226,7 +226,11 @@ class Plugin_PrettyURLs { if (strpos($_SERVER['REQUEST_URI'], BLOG_ROOT)!==false) { - $url = substr($_SERVER['REQUEST_URI'], strlen(BLOG_ROOT)-1); + $url = $_SERVER['REQUEST_URI']; + $del = BLOG_ROOT; + if (strpos($url, 'index.php')!==false) + $del = $del . 'index.php/'; + $url = substr($url, strlen($del)-1); } if ($url=='/') @@ -268,7 +272,6 @@ class Plugin_PrettyURLs { if ($this->status == 2) return; - if ($this->date_handled){ $url = preg_replace_callback('|^/([^/]+)|', array(&$this, 'handle_entry'), $url); // if status = 2 @@ -502,9 +505,7 @@ STR; function onsubmit() { global $fp_config; - if ($_POST['wp-apikey']){ - - + if (!empty($_POST['htaccess']) && io_write_file(ABS_PATH.'.htaccess', $_POST['htaccess'])){ $this->smarty->assign('success', 1); } else { $this->smarty->assign('success', -1); diff --git a/fp-plugins/prettyurls/tpls/admin.plugin.prettyurls.tpl b/fp-plugins/prettyurls/tpls/admin.plugin.prettyurls.tpl index fa71788..dd75992 100644 --- a/fp-plugins/prettyurls/tpls/admin.plugin.prettyurls.tpl +++ b/fp-plugins/prettyurls/tpls/admin.plugin.prettyurls.tpl @@ -4,9 +4,7 @@ {include file=shared:errorlist.tpl} -
+{html_form}

@@ -20,4 +18,4 @@ {/if} -

+{/html_form} \ No newline at end of file