summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2006-12-10 22:07:22 +0000
committerMax Kremmel <xing@synapse.plus.com>2006-12-10 22:07:22 +0000
commitd407aa21957b3e7eb5b1bcadf1364d775aab1092 (patch)
tree82df379697765c4dfb428f21cd51e1befd40d866
parent8afa3ed55b20e7f2b77f4a19624fb0a2298fe0dc (diff)
downloadliberty-d407aa21957b3e7eb5b1bcadf1364d775aab1092.tar.gz
liberty-d407aa21957b3e7eb5b1bcadf1364d775aab1092.tar.bz2
liberty-d407aa21957b3e7eb5b1bcadf1364d775aab1092.zip
fix link id for titles that have html elements in them
-rw-r--r--plugins/data.maketoc.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/data.maketoc.php b/plugins/data.maketoc.php
index d57958e..b46b2c3 100644
--- a/plugins/data.maketoc.php
+++ b/plugins/data.maketoc.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Revision: 1.16 $
+ * @version $Revision: 1.17 $
* @package liberty
* @subpackage plugins_data
*/
@@ -15,7 +15,7 @@
// +----------------------------------------------------------------------+
// | Author: xing <xing@synapse.plus.com>
// +----------------------------------------------------------------------+
-// $Id: data.maketoc.php,v 1.16 2006/11/26 14:51:45 squareing Exp $
+// $Id: data.maketoc.php,v 1.17 2006/12/10 22:07:22 squareing Exp $
/**
* definitions
@@ -98,8 +98,8 @@ function data_maketoc( $data ) {
// remove any html tags from the output text and generate link ids
foreach( $headers[2] as $output ) {
- $outputs[] = preg_replace( "/<[^>]*>/", "", $output );
- $id = substr( preg_replace( "/<[^>]*>|[^\w|\d]*/", "", $output ), 0, 40 );
+ $outputs[] = $temp = preg_replace( "/<[^>]*>/", "", $output );
+ $id = substr( preg_replace( "/[^\w|\d]*/", "", $temp ), 0, 40 );
$ids[] = !empty( $id ) ? $id : 'id'.microtime() * 1000000;
}