aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojciech Polak <polak@gnu.org>2004-11-14 12:26:13 +0000
committerWojciech Polak <polak@gnu.org>2004-11-14 12:26:13 +0000
commit6babd80d1d04ae32aec09e1523db3531cddda548 (patch)
treeabc2c23657e61ff1971e756a5c47c58f2afd3ffc
parent228298be889b5b9e5cd981fff1bb1fa3df54521d (diff)
downloadblogright-6babd80d1d04ae32aec09e1523db3531cddda548.tar.gz
blogright-6babd80d1d04ae32aec09e1523db3531cddda548.tar.bz2
Added htmlentities2(). Bump to 1.4
-rw-r--r--index.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/index.php b/index.php
index 910fa25..05c9655 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,6 @@
<?php
-// blogRight! version 1.3
+// blogRight! version 1.4
// Copyright (C) 2004 Wojciech Polak.
//
// This program is free software; you can redistribute it and/or modify
@@ -458,7 +458,7 @@ function indent_include ($level, $file)
{
for ($i = 0; $i < $level; $i++)
print ' ';
- print (htmlentities ($line));
+ print (htmlentities2 ($line));
}
}
@@ -466,6 +466,14 @@ function indent_include ($level, $file)
}
}
+function htmlentities2 ($htmlcode)
+{
+ $table = get_html_translation_table (HTML_ENTITIES, ENT_QUOTES);
+ $table[chr(38)] = '&';
+ return preg_replace ("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/", "&amp;",
+ strtr ($htmlcode, $table));
+}
+
function microtime_diff ($a, $b)
{
list ($a_dec, $a_sec) = explode (' ', $a);

Return to:

Send suggestions and report system problems to the System administrator.