Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12973
Modified Files:
comment.php serendipity_functions.inc.php
Log Message:
Now the '+' separator style is only used for article overview URL generation
and URL detail link generation, as well as the two entry plugins. Every
other occurence uses the old '_' way to stay backwards compatible.
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.313
retrieving revision 1.314
diff -u -d -r1.313 -r1.314
--- serendipity_functions.inc.php 5 Jul 2004 09:31:27 -0000 1.313
+++ serendipity_functions.inc.php 5 Jul 2004 09:59:55 -0000 1.314
@@ -924,6 +924,8 @@
**/
function serendipity_makeFilename($str, $compat = true) {
static $from = array(
+ ' ',
+
'Ä',
'ä',
@@ -955,11 +957,11 @@
'ù',
'û',
- 'ý',
-
- ' ');
+ 'ý');
static $to = array(
+ '_',
+
'AE',
'ae',
@@ -991,9 +993,16 @@
'u',
'u',
- 'y',
+ 'y');
- '_');
+ // For pretty urls we want to have a '+' as word separator. But GUIDs need to stay used to using '_' to not break bc.
+ // (For performance reasons this changes the static array instead of using a second str_replace call only for the ' ' case,
+ // and to avoid a costy call to array_merge()
+ if ($compat !== true) {
+ $to[0] = '+';
+ } else {
+ $to[0] = '_';
+ }
$str = str_replace($from, $to, $str);
return preg_replace('#[^' . PAT_FILENAME . ']#i', '', $str);
@@ -1097,7 +1106,7 @@
<?php
foreach ($ents as $x => $entry) {
- $entryLink = serendipity_archiveURL($entry['id'], $entry['title'], 'serendipityHTTPPath');
+ $entryLink = serendipity_archiveURL($entry['id'], $entry['title'], 'serendipityHTTPPath', false);
serendipity_plugin_api::hook_event('frontend_display', $entry);
$html_extended = '';
@@ -1273,7 +1282,7 @@
<?php
foreach ($bydate as $date => $ents) {
foreach ($ents as $x => $entry) {
- echo '<a href="' . serendipity_archiveURL($entry['id'], $entry['title'], 'serendipityHTTPPath') . '">' . $entry['title'] . '</a>' . "\n";
+ echo '<a href="' . serendipity_archiveURL($entry['id'], $entry['title'], 'serendipityHTTPPath', false) . '">' . $entry['title'] . '</a>' . "\n";
echo '<br />' . "\n";
}
}
Index: comment.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/comment.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- comment.php 17 Jun 2004 20:13:48 -0000 1.36
+++ comment.php 5 Jul 2004 09:59:55 -0000 1.37
@@ -102,11 +102,7 @@
$tbu = $serendipity['baseURL'] . 'comment.php?type=trackback&entry_id=' . $serendipity['GET']['entry_id'];
$query = 'SELECT title FROM ' . $serendipity['dbPrefix'] . 'entries WHERE id = ' . $serendipity['GET']['entry_id'];
$entry = serendipity_db_query($query);
- $entry = $serendipity['baseURL']
- . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '')
- . 'archives/'
- . $serendipity['GET']['entry_id']
- . '_' . serendipity_makeFilename($entry[0]['title']) . '.html';
+ $entry = serendipity_archiveURL($serendipity['GET']['entry_id'], $entry[0]['title'], 'baseURL', false); $serendipity['baseURL'];
?>
<div class="serendipity_commentsTitle"><?php echo TRACKBACKS; ?></div><br />
<dl>
|