@@ -13,41 +13,41 @@ function evo()
1313 define ('EVO_CLASS ' , '\DocumentParser ' );
1414 }
1515
16- global $ modx ;
17- if ($ modx === null ) {
16+ global $ evo ;
17+ if ($ evo === null ) {
1818 try {
1919 $ obj = new ReflectionClass (EVO_CLASS );
20- $ modx = $ obj ->newInstanceWithoutConstructor ()->getInstance ();
20+ $ evo = $ obj ->newInstanceWithoutConstructor ()->getInstance ();
2121 } catch (ReflectionException $ exception ) {
2222 echo $ exception ->getMessage ();
2323 exit ($ exception ->getCode ());
2424 }
2525 }
2626
27- if (IN_MANAGER_MODE == true && IN_INSTALL_MODE == false && MODX_API_MODE != true ) {
27+ if (IN_MANAGER_MODE == true && IN_INSTALL_MODE == false && EVO_API_MODE != true ) {
2828 // attempt to foil some simple types of CSRF attacks
29- if ((int )$ modx ->getConfig ('validate_referer ' ) !== 0 ) {
29+ if ((int )$ evo ->getConfig ('validate_referer ' ) !== 0 ) {
3030 if (isset ($ _SERVER ['HTTP_REFERER ' ])) {
3131
3232 $ referer = $ _SERVER ['HTTP_REFERER ' ];
3333
3434 if (!empty ($ referer )) {
35- if (!preg_match ('/^ ' . preg_quote (MODX_SITE_URL , '/ ' ) . '/i ' , $ referer )) {
36- $ modx ->webAlertAndQuit (
35+ if (!preg_match ('/^ ' . preg_quote (EVO_SITE_URL , '/ ' ) . '/i ' , $ referer )) {
36+ $ evo ->webAlertAndQuit (
3737 "A possible CSRF attempt was detected from referer: {$ referer }. " ,
3838 "/ " . MGR_DIR . "/index.php "
3939 );
4040 }
4141 } else {
42- $ modx ->webAlertAndQuit (
42+ $ evo ->webAlertAndQuit (
4343 "A possible CSRF attempt was detected. No referer was provided by the client. " ,
4444 "/ " . MGR_DIR . "/index.php "
4545 );
4646 }
4747 } else {
4848
4949 if (mb_strtoupper ($ _SERVER ['REQUEST_METHOD ' ]) !== 'GET ' ) {
50- $ modx ->webAlertAndQuit (
50+ $ evo ->webAlertAndQuit (
5151 "A possible CSRF attempt was detected. No referer was provided by the server. " ,
5252 "/ " . MGR_DIR . "/index.php "
5353 );
@@ -57,7 +57,7 @@ function evo()
5757 }
5858 }
5959
60- return $ modx ;
60+ return $ evo ;
6161 }
6262}
6363
@@ -110,7 +110,7 @@ function startCMSSession()
110110 }
111111 session_set_cookie_params (
112112 0
113- , $ session_cookie_path ? $ session_cookie_path : MODX_BASE_URL
113+ , $ session_cookie_path ? $ session_cookie_path : EVO_BASE_URL
114114 , $ session_cookie_domain ? $ session_cookie_domain : ''
115115 , $ secure
116116 , true
@@ -159,7 +159,7 @@ function startCMSSession()
159159 session_name ()
160160 , session_id ()
161161 , (int )$ _SESSION [$ key ] ? $ _SERVER ['REQUEST_TIME ' ] + (int )$ _SESSION [$ key ] : 0
162- , $ session_cookie_path ? $ session_cookie_path : MODX_BASE_URL
162+ , $ session_cookie_path ? $ session_cookie_path : EVO_BASE_URL
163163 , $ session_cookie_domain ? $ session_cookie_domain : ''
164164 , $ secure
165165 , true
@@ -251,7 +251,7 @@ function getSanitizedValue($value = '')
251251 }
252252 $ sanitizedBracket = str_replace (
253253 '# ' ,
254- MODX_SANITIZE_SEED ,
254+ EVO_SANITIZE_SEED ,
255255 sprintf ('#%s#%s# ' , substr ($ bracket , 0 , 1 ), substr ($ bracket , 1 , 1 ))
256256 );
257257 $ value = str_replace ($ bracket , $ sanitizedBracket , $ value );
@@ -269,10 +269,10 @@ function getSanitizedValue($value = '')
269269 */
270270 function removeSanitizeSeed ($ string = '' )
271271 {
272- if (!$ string || strpos ($ string , MODX_SANITIZE_SEED ) === false ) {
272+ if (!$ string || strpos ($ string , EVO_SANITIZE_SEED ) === false ) {
273273 return $ string ;
274274 }
275275
276- return str_replace (MODX_SANITIZE_SEED , '' , $ string );
276+ return str_replace (EVO_SANITIZE_SEED , '' , $ string );
277277 }
278278}
0 commit comments