r14943 - htdocs/trunk/news - Try new anchor-fragment generator that should be more tolerant of how it's invoked.

Joshua Sled jsled at cvs.gnucash.org
Mon Oct 9 09:41:05 EDT 2006


Author: jsled
Date: 2006-10-09 09:41:04 -0400 (Mon, 09 Oct 2006)
New Revision: 14943
Trac: http://svn.gnucash.org/trac/changeset/14943

Modified:
   htdocs/trunk/news/news-script.php
Log:
Try new anchor-fragment generator that should be more tolerant of how it's invoked.

Modified: htdocs/trunk/news/news-script.php
===================================================================
--- htdocs/trunk/news/news-script.php	2006-10-09 13:31:12 UTC (rev 14942)
+++ htdocs/trunk/news/news-script.php	2006-10-09 13:41:04 UTC (rev 14943)
@@ -90,9 +90,14 @@
     return $newsfile;
 }
 
+/**
+ * @return From the last '/' through the end of the string.  Too many
+ * double-slash and leading '.' issues due to lang directories,
+ * otherwise. :(
+ **/
 function generate_anchor($news_key)
 {
-  return urlencode(substr($news_key, strpos($news_key, '/', 2)+1));
+  return urlencode(substr(strrchr($news_key, '/'), 1));
 }
 
 function emit_news($en_newspath, $lang_newspath, $oldnews)



More information about the gnucash-changes mailing list