|
|
dedecms安装完成后会出现登陆后台空白,发布文章时提示”标题不能为空”。
- o) g. }. [' ?# C2 l- C) ~
6 Y% X' K' A, o- c" `1.解决dedecms登陆后台空白错误3 D0 {- }6 K6 G# Q/ M0 c# X
因为php5.5的版本废除了session_register,所以需要去掉session_register函数
/ h/ O. ^0 ?: w5 o2 F+ t' H# K+ q
修改:“include/userlogin.class.php”,注释掉session_register,修改后如下6 q4 M, S8 j; {: L1 e5 g
//@session_register($this->keepUserIDTag);$ B, Z$ j$ T" d
$_SESSION[$this->keepUserIDTag] = $this->userID;
4 N) J* m9 P* \1 s0 |0 Q
% ~8 E0 z/ I4 x, e// @session_register($this->keepUserTypeTag);5 S0 F* ~; e4 \4 E- s' c1 s% X
$_SESSION[$this->keepUserTypeTag] = $this->userType;
9 F4 d6 D' |0 f
6 l& @0 u W6 Y( u2 f// @session_register($this->keepUserChannelTag);) S0 A1 \5 j u8 g5 a' \
$_SESSION[$this->keepUserChannelTag] = $this->userChannel;2 G- a5 M; Q# D0 e0 E* ]) E9 S
& M" O2 o- Z$ I. f// @session_register($this->keepUserNameTag);2 E. R$ i6 R% f7 _- r
$_SESSION[$this->keepUserNameTag] = $this->userName;
: K5 N P2 I7 X( K/ o' J2 O- v8 K2 i/ B' x
// @session_register($this->keepUserPurviewTag);1 N1 U. T, {3 v3 d5 ^& S: ?8 K/ S
$_SESSION[$this->keepUserPurviewTag] = $this->userPurview;
4 E% E% N: T# J5 a& k! R
" l$ { X v/ N4 ~6 Z// @session_register($this->keepAdminStyleTag);) i, k: O9 A# N3 ~2 f
$_SESSION[$this->keepAdminStyleTag] = $adminstyle;% }+ Q4 E5 h# u* T0 o. d
) }* P5 d5 c5 o" I1 G/ U# l
2.dedecms发布文章提示"标题不能为空"
$ s# {6 H V! D2 V
7 {5 }0 u" H& B现象是发布英文标题没问题,发布中文会提示“标题不能为空”# _* ^1 N# z0 z7 J3 H7 Z
因为htmlspecialchars在php5.4默认为utf8编码,
8 s" v3 w$ X7 I* hgbk编码字符串经 htmlspecialchars 转义后的中文字符串为空,也就是标题为空。
' O( `/ p4 R S5 s+ h, Y9 J. V- r所以给htmlspecialchars添加ENT_COMPAT ,'GB2312'参数修改编码默认值。
: w, z+ ^# g5 [. K ~( w/ ~/ ~6 A; ?" S" Q1 r( Y8 d1 |- ]
具体方法:
' \& U. q- a5 Z `( G1 k4 B1.在dede安装目录执行; ]9 n2 z3 W G( C
sed -i "s/htmlspecialchars(/gbkhtmlspecialchars(/g" `grep htmlspecialchars\( -rl *`6 u3 q# Q0 D9 M* Q/ }
& n: v. f+ I' V w
2./include/common.func.php中任意位置添加函数
( L5 a3 i5 g3 {6 o
C/ g+ v9 O/ x; D8 ofunction gbkhtmlspecialchars($str)
- e& C' R3 ^: n$ h$ J- {{5 T2 D h1 `/ u- w& s) T
return htmlspecialchars($str, ENT_COMPAT ,'ISO-8859-1');
9 ~+ \ ~$ J1 @" L}
) `% b! e+ y$ H0 f. o注意:使用了本文方法的就不用理会这篇文章了:http://bbs.swdyz.com/thread329sw1dyz1.shtml) q: J3 L2 `9 l4 h" Q9 d# j3 l
9 c8 n; S, K, G5 l h% L) W5 [) Z
|
|