$7.49 .com domain with free InstantPage Website Builder$1.99 Web Hosting   捷飞网络官方淘宝店   Godaddy 优惠码
返回列表 发帖
分享到:




[Bug&安全&补丁] PHP 5.3 Support for Zen Cart v1.3.8 / v1.3.8a

PHP 5.3 was released a few months ago, and along with it come many problems due to the PHP authors' decisions to backport many PHP 6 features into 5.3 and deprecate several oft-required functions.5 s/ O( j( x" n7 Y. n
6 ^8 k1 V% D* R" u2 p
In so doing, they broke many things affecting Zen Cart operation in v1.3.8a and older.* J7 }2 o: f' Z; X2 m0 c% {

; Z# C. X3 Y6 y  zWe are preparing a patch which can be used by those whose hosts have upgraded (or have announced imminent plans to upgrade) to PHP 5.3.% [, W; f! k( B7 v' ]. V9 P
3 O( T8 ?5 l7 _: t) o' K0 u0 o
8 p& d: x  }. j( E: h8 x
We hope to post the patch here very soon. It's in regression testing now.. p6 J4 e( V3 m6 ^
When the patch is ready it will be announced here in the Announcements area.
6 H3 Z3 R- k0 l& U0 m4 X/ t2 `$ _4 o, f5 I5 B, V) B- D+ n
Zen Cart v1.3.9 and newer are compatible with PHP 5.3
4 k( b( ^% ?) ^- x
PHP 5.3 patch for Zen Cart v1.3.8 / v1.3.8a
2 r5 |- b% T8 D' i+ t; f===========================================: n! w8 z% |, ?/ W1 U' D3 H+ l

! \% p+ w! o7 ?1 S, H) uThis patch is ONLY needed if you are attempting to run Zen Cart v1.3.8 on a server which is using PHP 5.3.x+ H( ?/ i; R' p1 i: l6 E4 O
(NOTE: if you've applied any other posted bugfixes for v1.3.8a, you'll need to be careful when merging these files along with these patches;
; c& m' L+ I4 c. t3 q3 cFor that reason, it's not recommended to install this patch unless you *are* actually using PHP 5.3)4 |- ~5 J5 q9 `  L8 K* \% H$ ^

: n! p8 i1 W  k: B, \THIS PATCH IS **NOT** COMPATIBLE WITH PRIOR VERSIONS OF ZEN CART.( h6 M* }6 G6 Q* ^1 L
THE ATTACHED ZIP IS ONLY SUITABLE FOR v1.3.8 / v1.3.8a sites.
7 ?% E! Y* L& x* d. q+ q% S/ U1 w5 i, t" u3 W

$ d' O! h0 j0 t5 E( \INSTALLATION INSTRUCTIONS:" y, G; E: [  d& m% l- y- h
==========================
+ z7 O4 @- p: V! ]& I9 J1. Unzip the zc138a-php53patch.zip file, using the option which expands included subdirectories. It's important that you know which subdirectory/folder each file belongs in, as indicated by its location after unzipping.
# q' z" |3 t5 C
( e8 E8 D0 k1 n, J4 l2. Copy the files to your server. NOTE THE FOLLOWING:
! X, I1 T. n- h3 c# `% c# ~2 j# n% p3 A& k7 d7 T, ~! |. u7 q! l: r
a) If you have NOT customized any of these 11 files on your site already, simply copy the new versions of these files overtop of your existing ones.
. ~, l! f2 H, {8 M# u$ D! U% O4 P* F! h4 ^6 Q  P; G# }& Z5 ~% d
b) If you HAVE customized them, either by manual editing or by installing any addons that have altered the files from their original state, you'll need to manually merge the new changes into the files yourself. WinMerge is a handy free tool for doing such merging. http://winmerge.sf.net
. K. q' b4 \! z6 P( ~
/ [/ [3 @. N5 ~* C5 D. e7 l7 Q  Y* ^
11 FILES AFFECTED:& s, j- t1 \7 D' \1 x- N& i
==========================2 h& C' r1 _/ q1 V& D5 h$ _" \
/admin/includes/application_top.php
% x" W+ F1 ^' e# S$ o2 j" r$ W4 V/admin/includes/classes/phplot.php; A* x- B, w1 }
/admin/includes/functions/general.php
! D- ~" z, a: T% ~/admin/includes/functions/html_output.php6 O: a5 t* _+ g3 z. v5 C# N
/admin/includes/header.php) a1 g& u5 h$ g/ H7 x* D
/admin/includes/modules/orders_download.php
. S5 f# a' ^- T" B2 J/admin/orders.php# [% ?% }, \, q  O" O+ q- K
/includes/application_top.php: s2 j! @6 x7 I
/includes/functions/functions_general.php
' Z, c: L3 S) L. v$ R/includes/functions/html_output.php
- {' B8 e. R4 T; v8 Y0 g$ N, \8 \/includes/modules/payment/paypal/paypal_functions.php
9 A# c0 {; m( X1 W/zc_install/includes/classes/installer.php$ r. a% q, x* Y- ~, v  U; p- A" p
/zc_install/includes/application_top.php
6 m( T: q5 q& \/ o+ L9 ^8 I
# E7 g6 c) ^4 j, |( V( e) ^NOTES:( l) U0 z2 A+ G  O+ x
- You will note that there are many similar filenames, such as application_top.php and html_output.php. TAKE CARE THAT YOU USE THE RIGHT VERSION OF THESE FILES! ie: the /admin/includes/application_top.php file IS DIFFERENT FROM the /includes/application_top.php file, which IS ALSO DIFFERENT form the /zc_install/includes/application_top.php file.$ o9 @3 A/ v8 o' s8 B
: e' P( q( K$ H% N% [
- If you are patching a live site, you DO NOT need the zc_install file update on your live server. That file is only needed if you are trying to do a new install on a server running PHP 5.3
0 _- U, f. A6 V' m2 r2 |- q6 b6 W) G' j

8 l$ @5 m( G( ~; g0 F: u9 `And ... for everyone who wonders ...  i6 l" p. j3 U7 }

& G2 E- N: @8 d  z9 \4 {+ i/ d9 `The "missing" ?> tag at the end of various files is intentional. See this related FAQ: ) U+ U& @$ t6 J; o# V
http://tutorials.zen-cart.com/index.php?article=313
9 O+ \5 O( k: G- z& `: t! X7 m& g7 ^
download:
附件: 您需要登录才可以下载或查看附件。没有帐号?加入我们

For v1.3.7 / v1.3.7.1 you may try the following manual edits which cover the basics, but NOT ALL of the possible issues. You really should be upgrading to at least 1.3.9 if you want PHP 5.3 support:1 Y( w7 I0 J& x/ m+ u
# J) X# ^  G, T: Z7 m( m
/includes/application_top.php" H. @& v! h$ w" x# |$ L/ S3 C
line 51
$ ^# |" @- B! O& e, w* p3 ~change:
8 X! W% |9 o# J9 R5 B/ z. S( verror_reporting(E_ALL & ~E_NOTICE);
* j: B  f5 `% p; \1 d& Kto:' k& W; I" V; N  t
error_reporting(0);% ^7 v  u1 _' U1 f; G  O

1 p, S# `5 {3 _  ~7 O5 }
7 ~- `" Z3 L- W7 _2 E/includes/modules/payment/paypal/paypal_functions.php
% u% x/ E& B% M0 |: Cline 476% z( d4 \9 x2 J( g0 _0 X
change:
* p; P$ T* s2 Z. j5 z0 o, M7 U$zc_max_days = date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + (int)DOWNLOAD_MAX_DAYS;" c7 c6 o0 A7 o" e# F
to:' p8 }. H1 @; n) A* Y  t4 C
$zc_max_days = zen_date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + (int)DOWNLOAD_MAX_DAYS;
' Q9 _, J9 _% z! ]/ l
8 V4 H4 L, c' _7 K+ x" J2 q/includes/functions/functions_general.php1 t; `/ H% a$ j4 @* _
line 1435# r6 l9 ?' W9 @8 C  o8 ~
change:
- P/ m/ {5 p% {6 K- \function date_diff($date1, $date2) {( \+ Q, W% c+ K: S  H5 g
to:& x8 q4 ^  j- w+ C
function zen_date_diff($date1, $date2) {
1 G8 ]2 v6 o% b+ o
! c1 D3 R  b; f$ T$ D* W5 m, g
; p$ k, J7 ?, q& p: J, \' d/admin/orders.php3 s8 j! s6 z/ N4 O8 v) \
line 53:
) g( r5 J, m5 `- f3 Qchange:9 u; t. x& @: t. r% l) |4 C( ~
$zc_max_days = date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + DOWNLOAD_MAX_DAYS;
$ m- W& [0 K- s/ K) [to:3 Y0 o( ?! A6 j* e4 h( V- B
$zc_max_days = zen_date_diff($check_status->fields['date_purchased'], date('Y-m-d H:i:s', time())) + DOWNLOAD_MAX_DAYS;
# z- u2 S4 Y, T" {$ h: Y2 w) B( x. W* k# I
" r2 y* n% V0 W
/admin/includes/application_top.php9 `* c# L! l# Q) M! l& Q
line 490 o7 i2 p$ y+ \/ a: x
change:, L) E+ v; Y/ N- |1 t
error_reporting(E_ALL & ~E_NOTICE);" E. x% N, K- a# F3 L' h2 |0 s9 L
to:
# m( X! w* K1 ]2 A3 _% ~error_reporting(0);1 N2 b. |5 m; r5 t+ Q) [
  [& E" o+ p1 E! q
/admin/includes/functions/general.php$ R$ p1 _( C9 ?; N6 f; B
line 2980
  k! G+ m. z0 H: kchange:6 X, s" z6 \; I" T
function date_diff($date1, $date2) {
6 X5 F% L* ]5 dto:
  r$ a( s/ p( d, Dfunction zen_date_diff($date1, $date2) {- s  p0 J5 i( A# B9 a+ B
5 _3 G+ P+ g1 E  a) Q! `+ O. P
The v1.3.8 instructions list additional files which are irrelevant for older versions, which is why some of those filenames are not in this list.3 ?1 {0 H! [' L% x/ }9 R  e, B

( B6 M+ u  C. a. h8 ?/ Z% y1 j7 iThese v1.3.7 instructions may work for older versions. USE AT YOUR OWN RISK. You REALLY SHOULD BE UPGRADING INSTEAD., k: K& m7 q2 }3 Q3 \  ^( {% L
0 \) A* R7 g" N7 O& X  _
参考:http://www.zen-cart.com/forum/showthread.php?t=140960

美国VPS、域名代购:http://tu8l.taobao.com

TOP

返回列表
Namecheap
Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting
互联网安全