From e1800a17c2031886d0b739775492c7c833664635 Mon Sep 17 00:00:00 2001 From: Jeff Teunissen Date: Thu, 22 Mar 2007 05:41:34 +0000 Subject: [PATCH] Rename library .php files to .inc, so they don't get served out as pages. --- lib/{array.php => array.inc} | 0 lib/{auth.php => auth.inc} | 0 lib/{boxes.php => boxes.inc} | 0 lib/{cache.php => cache.inc} | 0 lib/{date.php => date.inc} | 0 lib/{feature.php => feature.inc} | 0 lib/{file.php => file.inc} | 0 lib/{graph.php => graph.inc} | 0 lib/{html.php => html.inc} | 0 lib/{needs.php => needs.inc} | 0 lib/{network.php => network.inc} | 0 lib/{news.php => news.inc} | 0 lib/{rss.php => rss.inc} | 6 +++--- lib/{sql.php => sql.inc} | 0 lib/{table.php => table.inc} | 0 parts/head.php | 5 ++++- parts/library.php | 27 ++++++++++++++++++++++++--- parts/menu.php | 2 +- 18 files changed, 32 insertions(+), 8 deletions(-) rename lib/{array.php => array.inc} (100%) rename lib/{auth.php => auth.inc} (100%) rename lib/{boxes.php => boxes.inc} (100%) rename lib/{cache.php => cache.inc} (100%) rename lib/{date.php => date.inc} (100%) rename lib/{feature.php => feature.inc} (100%) rename lib/{file.php => file.inc} (100%) rename lib/{graph.php => graph.inc} (100%) rename lib/{html.php => html.inc} (100%) rename lib/{needs.php => needs.inc} (100%) rename lib/{network.php => network.inc} (100%) rename lib/{news.php => news.inc} (100%) rename lib/{rss.php => rss.inc} (91%) rename lib/{sql.php => sql.inc} (100%) rename lib/{table.php => table.inc} (100%) diff --git a/lib/array.php b/lib/array.inc similarity index 100% rename from lib/array.php rename to lib/array.inc diff --git a/lib/auth.php b/lib/auth.inc similarity index 100% rename from lib/auth.php rename to lib/auth.inc diff --git a/lib/boxes.php b/lib/boxes.inc similarity index 100% rename from lib/boxes.php rename to lib/boxes.inc diff --git a/lib/cache.php b/lib/cache.inc similarity index 100% rename from lib/cache.php rename to lib/cache.inc diff --git a/lib/date.php b/lib/date.inc similarity index 100% rename from lib/date.php rename to lib/date.inc diff --git a/lib/feature.php b/lib/feature.inc similarity index 100% rename from lib/feature.php rename to lib/feature.inc diff --git a/lib/file.php b/lib/file.inc similarity index 100% rename from lib/file.php rename to lib/file.inc diff --git a/lib/graph.php b/lib/graph.inc similarity index 100% rename from lib/graph.php rename to lib/graph.inc diff --git a/lib/html.php b/lib/html.inc similarity index 100% rename from lib/html.php rename to lib/html.inc diff --git a/lib/needs.php b/lib/needs.inc similarity index 100% rename from lib/needs.php rename to lib/needs.inc diff --git a/lib/network.php b/lib/network.inc similarity index 100% rename from lib/network.php rename to lib/network.inc diff --git a/lib/news.php b/lib/news.inc similarity index 100% rename from lib/news.php rename to lib/news.inc diff --git a/lib/rss.php b/lib/rss.inc similarity index 91% rename from lib/rss.php rename to lib/rss.inc index 681b9ab..3c6b37b 100644 --- a/lib/rss.php +++ b/lib/rss.inc @@ -42,7 +42,7 @@ $channelTitle = $info[1]; $channelLink = $info[2]; $channelDesc = $info[3]; - echo "

" . unhtmlentities ($channelTitle) . "

"; + echo "

" . convertFromHTML ($channelTitle) . "

"; } } @@ -55,7 +55,7 @@ $title = $info[1][$i]; $link = $info[2][$i]; $desc = $info[3][$i]; - echo "

" . unhtmlentities ($title) . "

\n"; + echo "

" . convertFromHTML ($title) . "

\n"; } } @@ -63,4 +63,4 @@ { displayRSSFeed ('http://rss.slashdot.org/Slashdot/slashdot', false); } -?> +?> \ No newline at end of file diff --git a/lib/sql.php b/lib/sql.inc similarity index 100% rename from lib/sql.php rename to lib/sql.inc diff --git a/lib/table.php b/lib/table.inc similarity index 100% rename from lib/table.php rename to lib/table.inc diff --git a/parts/head.php b/parts/head.php index 4ee91c7..6aef9e0 100644 --- a/parts/head.php +++ b/parts/head.php @@ -1,7 +1,11 @@ + + + + @@ -14,7 +18,6 @@ } echo "$siteName: $pageName"; ?> - diff --git a/parts/library.php b/parts/library.php index c6472f9..2521a2f 100644 --- a/parts/library.php +++ b/parts/library.php @@ -41,7 +41,7 @@ } if (!defined ('_ARRAY_')) { // Treat array handler special - require siteHome . "/lib/array.php"; + require siteHome . "/lib/array.inc"; } if (!defined ('_LIBFUNCS_')) { @@ -61,7 +61,7 @@ for ($i = 0 ; $i < count ($libs) ; $i++ ) { $lib = $libs[$i]; if ((inArray ($libs[$i], $needs)) && (!inArray ($libs[$i], $has))) { - include siteHome . "/lib/$libs[$i].php"; + include siteHome . "/lib/$libs[$i].inc"; } } } @@ -100,8 +100,29 @@ if (strlen ($str)) echo $str; - require siteHome . '/parts/postamble.php'; // end page die; } + + function stripAllSlashes (&$var) + { + if (is_array ($var)) { + foreach (array_keys ($var) as $key) { + if (is_array($var[$key])) { + stripAllSlashes ($var[$key]); + } else { + $var[$key] = stripSlashes ($var[$key]); + } + } + } else { + $var = stripSlashes ($var); + } + } + + if (true && get_magic_quotes_gpc()) { // unquote $_GET, $_POST, $_COOKIE + stripAllSlashes ($_GET); + stripAllSlashes ($_POST); + stripAllSlashes ($_COOKIE); + stripAllSlashes ($_REQUEST); + } } // !_LIBFUNCS_ ?> diff --git a/parts/menu.php b/parts/menu.php index 2944c5e..f9adc82 100644 --- a/parts/menu.php +++ b/parts/menu.php @@ -76,6 +76,6 @@ // searchMenu (); ?> - +