Profile
MAJ is an Open Source, PHP-based content management system (CMS) that can be deployed as a blog, bulletin or message board, Internet forum, and wiki. It is extensible via PHP panels and is HTML5 and CSS3 ready.
Git
This commit has been accessed 948 times via Git panel.

commit 776cc2216c44240b4885a0480c1c77d0c408518f
tree 5e536187c0330523bbd23751e71e273b78b0b376
parent 97bfad0e1f5b7e934037d42ef799bdad266b02ad
author Engels Antonio <engels@majcms.org> 1277314186 +0800
committer Engels Antonio <engels@majcms.org> 1277314186 +0800

    maj-0.14-20060918.zip

diff --git a/add.php b/add.php
index cd6c15a..65608b5 100644
--- a/add.php
+++ b/add.php
@@ -2,6 +2,8 @@
 session_start();
 header("Cache-control: private");
 
+error_reporting(E_ERROR);
+
 if (isset($_REQUEST['title_input']) and isset($_REQUEST['body_input']) and !empty($_REQUEST['title_input']) and !empty($_REQUEST['body_input'])) {
        header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']));
 }
diff --git a/cat.php b/cat.php
index 08733cc..fad3f08 100644
--- a/cat.php
+++ b/cat.php
@@ -3,6 +3,8 @@
 session_start();
 header("Cache-control: private");
 
+error_reporting(E_ERROR);
+
 $login_username = file_get_contents("data/username.txt");
 
 if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
diff --git a/colors.php b/colors.php
index 0ce9dfc..cf26860 100644
--- a/colors.php
+++ b/colors.php
@@ -2,6 +2,8 @@
 session_start();
 header("Cache-control: private");
 
+error_reporting(E_ERROR);
+
 $login_username = file_get_contents("data/username.txt");
 
 if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
diff --git a/del.php b/del.php
index 6c6740d..5e297f1 100644
--- a/del.php
+++ b/del.php
@@ -2,6 +2,8 @@
 session_start();
 header("Cache-control: private");
 
+error_reporting(E_ERROR);
+
 $login_username = file_get_contents("data/username.txt");
 
 function rmdirr($recurse_dirname)
diff --git a/dig.php b/dig.php
index c20075f..42758a8 100644
--- a/dig.php
+++ b/dig.php
@@ -3,6 +3,8 @@
 session_start();
 header("Cache-control: private");
 
+error_reporting(E_ERROR);
+
 ?>
 
 <title>Dig!</title>
@@ -84,6 +86,10 @@ if ($dh_search_items = opendir($dir)) {
                        continue;
                }
 
+               if (file_exists("data/items/$entry_search_items/passwd.txt") and (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username))) {
+                       continue;
+               }
+
                if ($entry_search_items != "." && $entry_search_items != "..") {
                        $total_entries[] = $entry_search_items;
                }
diff --git a/edit.php b/edit.php
index 3beb47f..d562ef3 100644
--- a/edit.php
+++ b/edit.php
@@ -2,6 +2,8 @@
 session_start();
 header("Cache-control: private");
 
+error_reporting(E_ERROR);
+
 $login_username = file_get_contents("data/username.txt");
 
 function rmdirr($recurse_dirname)
diff --git a/index.php b/index.php
index a185c8d..e8a3390 100644
--- a/index.php
+++ b/index.php
@@ -5,6 +5,8 @@ ini_set("session.use_trans_sid", 0);
 session_start();
 header("Cache-control: private");
 
+error_reporting(E_ERROR);
+
 $dir = "data/items";
 
 $default_title = file_get_contents("data/title.txt");
@@ -440,6 +442,43 @@ else {
 
 ?>
 
+<?php
+
+if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry']) and file_exists("data/items/{$_REQUEST['entry']}")) {
+
+       $cat_dir = file_get_contents("data/items/{$_REQUEST['entry']}/category.txt");
+
+       if (!file_exists("data/categories/$cat_dir/private.txt")) {
+
+               if (!file_exists("data/items/{$_REQUEST['entry']}/passwd.txt")) {
+
+                       if (!file_exists("data/items/{$_REQUEST['entry']}/private.txt")) {
+
+                               $description = file_get_contents("data/items/{$_REQUEST['entry']}/body.txt");
+                               $description = strip_tags($description);
+                               $description = html_entity_decode($description);
+                               $description = str_replace("&","&amp;",$description);
+                               $description = str_replace("<","&lt;",$description);
+                               $description = str_replace(">","&gt;",$description);
+                               $description = str_replace("<br>"," ",$description);
+                               $description = str_replace("<br />"," ",$description);
+                               $description = str_replace("\r"," ",$description);
+                               $description = str_replace("\n"," ",$description);
+                               $description = str_replace(chr(10)," ",$description);
+                               $description = str_replace(chr(13)," ",$description);
+                               $description = trim($description);
+                               $description = substr($description,0,210);
+                               $description = htmlentities($description, ENT_NOQUOTES);
+
+                               echo "<meta name=\"description\" content=\"{$description}\">";
+                       }
+               }
+       }
+
+}
+
+?>
+
 <style>
 
 body
@@ -1664,10 +1703,10 @@ if (isset($_SESSION['logged_in']) and ($_SESSION['logged_in'] == $login_username
 <?php
 if (($start >= $increase) and ($start != 0)) {
        echo "<td align=left><p><a href=\"" . $_SERVER['PHP_SELF'] . "?";
-       if (isset($_REQUEST['category']) and !empty($_REQUEST['category']) and !file_exists("data/xcat.txt") and file_exists(strip_tags(strtolower(str_replace(" ", "_", "data/categories/{$_REQUEST['category']}"))))) {
+       if (isset($_REQUEST['category']) and !empty($_REQUEST['category']) and file_exists(strip_tags(strtolower(str_replace(" ", "_", "data/categories/{$_REQUEST['category']}"))))) {
                echo "category={$_REQUEST['category']}&";
        }
-       if (isset($_REQUEST['archive']) and !empty($_REQUEST['archive']) and !file_exists("data/xarc.txt")) {
+       if (isset($_REQUEST['archive']) and !empty($_REQUEST['archive'])) {
                echo "archive={$_REQUEST['archive']}&";
        }
        echo "start=" . ($start-$increase) . "\">previous</a></p></td>";
@@ -1675,10 +1714,10 @@ if (($start >= $increase) and ($start != 0)) {
 
 if ($end < sizeof($items)) {
        echo "<td align=right><p><a href=\"" . $_SERVER['PHP_SELF'] . "?";
-       if (isset($_REQUEST['category']) and !empty($_REQUEST['category']) and !file_exists("data/xcat.txt") and file_exists(strip_tags(strtolower(str_replace(" ", "_", "data/categories/{$_REQUEST['category']}"))))) {
+       if (isset($_REQUEST['category']) and !empty($_REQUEST['category']) and file_exists(strip_tags(strtolower(str_replace(" ", "_", "data/categories/{$_REQUEST['category']}"))))) {
                echo "category={$_REQUEST['category']}&";
        }
-       if (isset($_REQUEST['archive']) and !empty($_REQUEST['archive']) and !file_exists("data/xarc.txt")) {
+       if (isset($_REQUEST['archive']) and !empty($_REQUEST['archive'])) {
                echo "archive={$_REQUEST['archive']}&";
        }
        echo "start=" . ($start+$increase) . "\">next</a></p></td>";
diff --git a/login.php b/login.php
index 9ff5356..0a1d2c6 100644
--- a/login.php
+++ b/login.php
@@ -2,6 +2,9 @@
 session_start();
 session_regenerate_id();
 header("Cache-control: private");
+
+error_reporting(E_ERROR);
+
 ?>
 
 <style>
diff --git a/panels.php b/panels.php
index 0a166d1..8f5014f 100644
--- a/panels.php
+++ b/panels.php
@@ -3,6 +3,8 @@
 session_start();
 header("Cache-control: private");
 
+error_reporting(E_ERROR);
+
 $login_username = file_get_contents("data/username.txt");
 
 if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
diff --git a/passwd.php b/passwd.php
index 9e225e7..7002d77 100644
--- a/passwd.php
+++ b/passwd.php
@@ -45,6 +45,8 @@ a:active {
 
 <?php
 
+error_reporting(E_ERROR);
+
 if (isset($_REQUEST['entry']) and !empty($_REQUEST['entry'])) {
 
        $dir = "data/items/" . $_REQUEST['entry'];
diff --git a/rss.php b/rss.php
index eebe4a6..66cbeb5 100644
--- a/rss.php
+++ b/rss.php
@@ -1,5 +1,7 @@
 <?php
 
+error_reporting(E_ERROR);
+
 if (isset($_REQUEST['ver']) and !empty($_REQUEST['ver'])) {
        $title_file = "data/title.txt";
        $fp_title = fopen($title_file, "r");
diff --git a/settings.php b/settings.php
index fee92d0..e6544b9 100644
--- a/settings.php
+++ b/settings.php
@@ -2,6 +2,8 @@
 session_start();
 header("Cache-control: private");
 
+error_reporting(E_ERROR);
+
 $login_username = file_get_contents("data/username.txt");
 
 if (!isset($_SESSION['logged_in']) or ($_SESSION['logged_in'] != $login_username)) {
diff --git a/sitemap.php b/sitemap.php
index c2ed80f..160448a 100644
--- a/sitemap.php
+++ b/sitemap.php
@@ -1,5 +1,7 @@
 <?php
 
+error_reporting(E_ERROR);
+
 $dir = "data/items";
 
 if ($dh_sitemap_items = opendir($dir)) {
 
Credits
Sunday, Sep 18, 2005, 12:00 AM (Revision 11 - Thursday, Jul 14, 2011, 7:30 PM)
Open Source enables software developers to stand on the shoulders of giants instead of reinventing the wheel, so to speak. Kudos and many thanks to the folks who made their work freely available for reuse in MAJ.

read more
Bugs and Exploits
Friday, Aug 26, 2005, 12:00 AM (Revision 23 - Wednesday, May 29, 2013, 5:25 AM)
Although MAJ started as a family project, care has been taken to make it as "safe" as possible. With more people now working on MAJ, bugs and exploitable code may sometimes slip in. We invite you to poke around and see if you can find any. Generally, there are two things you can do when you find a MAJ or PHP-related bug or exploit:

1. Take advantage of it. But hey, what's so exciting about messing up someone's blog? Ho-hum, right?
2. Report it here so that we can work on a fix and make MAJ better.

read more
Search
Download
MAJ 2.0
75 files
33164 downloads
MAJ 1.0
26 files
13196 downloads
MAJ 0.14
45 files
35116 downloads