@@ -6,13 +6,13 @@ discard block |
||
6 | 6 | * |
7 | 7 | * @author NAVER ([email protected]) |
8 | 8 | */ |
9 | -if(!defined('__XE__')) |
|
9 | +if (!defined('__XE__')) |
|
10 | 10 | { |
11 | 11 | exit(); |
12 | 12 | } |
13 | 13 | |
14 | 14 | // define an empty function to avoid errors when iconv function doesn't exist |
15 | -if(!function_exists('iconv')) |
|
15 | +if (!function_exists('iconv')) |
|
16 | 16 | { |
17 | 17 | eval(' |
18 | 18 | function iconv($in_charset, $out_charset, $str) |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | { |
221 | 221 | $oDB = DB::getInstance(); |
222 | 222 | $output = $oDB->executeQuery($query_id, $args, $arg_columns); |
223 | - if(!is_array($output->data) && count($output->data) > 0) |
|
223 | + if (!is_array($output->data) && count($output->data) > 0) |
|
224 | 224 | { |
225 | 225 | $output->data = array($output->data); |
226 | 226 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | function setUserSequence($seq) |
251 | 251 | { |
252 | 252 | $arr_seq = array(); |
253 | - if(isset($_SESSION['seq'])) |
|
253 | + if (isset($_SESSION['seq'])) |
|
254 | 254 | { |
255 | 255 | $arr_seq = $_SESSION['seq']; |
256 | 256 | } |
@@ -266,11 +266,11 @@ discard block |
||
266 | 266 | */ |
267 | 267 | function checkUserSequence($seq) |
268 | 268 | { |
269 | - if(!isset($_SESSION['seq'])) |
|
269 | + if (!isset($_SESSION['seq'])) |
|
270 | 270 | { |
271 | 271 | return false; |
272 | 272 | } |
273 | - if(!in_array($seq, $_SESSION['seq'])) |
|
273 | + if (!in_array($seq, $_SESSION['seq'])) |
|
274 | 274 | { |
275 | 275 | return false; |
276 | 276 | } |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | $num_args = func_num_args(); |
297 | 297 | $args_list = func_get_args(); |
298 | 298 | |
299 | - if($num_args) |
|
299 | + if ($num_args) |
|
300 | 300 | $url = Context::getUrl($num_args, $args_list); |
301 | 301 | else |
302 | 302 | $url = Context::getRequestUri(); |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | $num_args = func_num_args(); |
316 | 316 | $args_list = func_get_args(); |
317 | 317 | |
318 | - if($num_args) |
|
318 | + if ($num_args) |
|
319 | 319 | { |
320 | 320 | $url = Context::getUrl($num_args, $args_list, NULL, FALSE); |
321 | 321 | } |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | $num_args = func_num_args(); |
339 | 339 | $args_list = func_get_args(); |
340 | 340 | |
341 | - if($num_args) |
|
341 | + if ($num_args) |
|
342 | 342 | { |
343 | 343 | $url = Context::getUrl($num_args, $args_list, NULL, TRUE, TRUE); |
344 | 344 | } |
@@ -360,16 +360,16 @@ discard block |
||
360 | 360 | $num_args = func_num_args(); |
361 | 361 | $args_list = func_get_args(); |
362 | 362 | $request_uri = Context::getRequestUri(); |
363 | - if(!$num_args) |
|
363 | + if (!$num_args) |
|
364 | 364 | { |
365 | 365 | return $request_uri; |
366 | 366 | } |
367 | 367 | |
368 | 368 | $url = Context::getUrl($num_args, $args_list); |
369 | - if(strncasecmp('http', $url, 4) !== 0) |
|
369 | + if (strncasecmp('http', $url, 4) !== 0) |
|
370 | 370 | { |
371 | 371 | preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match); |
372 | - return substr($match[0], 0, -1) . $url; |
|
372 | + return substr($match[0], 0, -1).$url; |
|
373 | 373 | } |
374 | 374 | return $url; |
375 | 375 | } |
@@ -384,17 +384,17 @@ discard block |
||
384 | 384 | $num_args = func_num_args(); |
385 | 385 | $args_list = func_get_args(); |
386 | 386 | $request_uri = Context::getRequestUri(); |
387 | - if(!$num_args) |
|
387 | + if (!$num_args) |
|
388 | 388 | { |
389 | 389 | return $request_uri; |
390 | 390 | } |
391 | 391 | |
392 | 392 | $url = Context::getUrl($num_args, $args_list, NULL, FALSE); |
393 | - if(strncasecmp('http', $url, 4) !== 0) |
|
393 | + if (strncasecmp('http', $url, 4) !== 0) |
|
394 | 394 | { |
395 | 395 | preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match); |
396 | 396 | $url = Context::getUrl($num_args, $args_list, NULL, FALSE); |
397 | - return substr($match[0], 0, -1) . $url; |
|
397 | + return substr($match[0], 0, -1).$url; |
|
398 | 398 | } |
399 | 399 | return $url; |
400 | 400 | } |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | $num_args = func_num_args(); |
411 | 411 | $args_list = func_get_args(); |
412 | 412 | |
413 | - if(!$num_args) |
|
413 | + if (!$num_args) |
|
414 | 414 | { |
415 | 415 | return Context::getRequestUri(); |
416 | 416 | } |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | $num_args = func_num_args(); |
433 | 433 | $args_list = func_get_args(); |
434 | 434 | |
435 | - if(!$num_args) |
|
435 | + if (!$num_args) |
|
436 | 436 | { |
437 | 437 | return Context::getRequestUri(); |
438 | 438 | } |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | $args_list = func_get_args(); |
455 | 455 | |
456 | 456 | $request_uri = Context::getRequestUri(); |
457 | - if(!$num_args) |
|
457 | + if (!$num_args) |
|
458 | 458 | { |
459 | 459 | return $request_uri; |
460 | 460 | } |
@@ -463,10 +463,10 @@ discard block |
||
463 | 463 | $num_args = count($args_list); |
464 | 464 | |
465 | 465 | $url = Context::getUrl($num_args, $args_list, $domain); |
466 | - if(strncasecmp('http', $url, 4) !== 0) |
|
466 | + if (strncasecmp('http', $url, 4) !== 0) |
|
467 | 467 | { |
468 | 468 | preg_match('/^(http|https):\/\/([^\/]+)\//', $request_uri, $match); |
469 | - return substr($match[0], 0, -1) . $url; |
|
469 | + return substr($match[0], 0, -1).$url; |
|
470 | 470 | } |
471 | 471 | return $url; |
472 | 472 | } |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | function getCurrentPageUrl() |
480 | 480 | { |
481 | 481 | $protocol = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'; |
482 | - $url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
|
482 | + $url = $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; |
|
483 | 483 | return htmlspecialchars($url, ENT_COMPAT, 'UTF-8', FALSE); |
484 | 484 | } |
485 | 485 | |
@@ -504,12 +504,12 @@ discard block |
||
504 | 504 | */ |
505 | 505 | function cut_str($string, $cut_size = 0, $tail = '...') |
506 | 506 | { |
507 | - if($cut_size < 1 || !$string) |
|
507 | + if ($cut_size < 1 || !$string) |
|
508 | 508 | { |
509 | 509 | return $string; |
510 | 510 | } |
511 | 511 | |
512 | - if($GLOBALS['use_mb_strimwidth'] || function_exists('mb_strimwidth')) |
|
512 | + if ($GLOBALS['use_mb_strimwidth'] || function_exists('mb_strimwidth')) |
|
513 | 513 | { |
514 | 514 | $GLOBALS['use_mb_strimwidth'] = TRUE; |
515 | 515 | return mb_strimwidth($string, 0, $cut_size + 4, $tail, 'utf-8'); |
@@ -523,16 +523,16 @@ discard block |
||
523 | 523 | $char_count = 0; |
524 | 524 | |
525 | 525 | $idx = 0; |
526 | - while($idx < $string_length && $char_count < $cut_size && $char_width <= $max_width) |
|
526 | + while ($idx < $string_length && $char_count < $cut_size && $char_width <= $max_width) |
|
527 | 527 | { |
528 | 528 | $c = ord(substr($string, $idx, 1)); |
529 | 529 | $char_count++; |
530 | - if($c < 128) |
|
530 | + if ($c < 128) |
|
531 | 531 | { |
532 | 532 | $char_width += (int) $chars[$c - 32]; |
533 | 533 | $idx++; |
534 | 534 | } |
535 | - else if(191 < $c && $c < 224) |
|
535 | + else if (191 < $c && $c < 224) |
|
536 | 536 | { |
537 | 537 | $char_width += $chars[4]; |
538 | 538 | $idx += 2; |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | } |
546 | 546 | |
547 | 547 | $output = substr($string, 0, $idx); |
548 | - if(strlen($output) < $string_length) |
|
548 | + if (strlen($output) < $string_length) |
|
549 | 549 | { |
550 | 550 | $output .= $tail; |
551 | 551 | } |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | function zgap() |
562 | 562 | { |
563 | 563 | $time_zone = $GLOBALS['_time_zone']; |
564 | - if($time_zone < 0) |
|
564 | + if ($time_zone < 0) |
|
565 | 565 | { |
566 | 566 | $to = -1; |
567 | 567 | } |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | $t_min = substr($time_zone, 3, 2) * $to; |
575 | 575 | |
576 | 576 | $server_time_zone = date("O"); |
577 | - if($server_time_zone < 0) |
|
577 | + if ($server_time_zone < 0) |
|
578 | 578 | { |
579 | 579 | $so = -1; |
580 | 580 | } |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | */ |
602 | 602 | function ztime($str) |
603 | 603 | { |
604 | - if(!$str) |
|
604 | + if (!$str) |
|
605 | 605 | { |
606 | 606 | return; |
607 | 607 | } |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | $year = (int) substr($str, 0, 4); |
613 | 613 | $month = (int) substr($str, 4, 2); |
614 | 614 | $day = (int) substr($str, 6, 2); |
615 | - if(strlen($str) <= 8) |
|
615 | + if (strlen($str) <= 8) |
|
616 | 616 | { |
617 | 617 | $gap = 0; |
618 | 618 | } |
@@ -636,19 +636,19 @@ discard block |
||
636 | 636 | $gap = $_SERVER['REQUEST_TIME'] + zgap() - ztime($date); |
637 | 637 | |
638 | 638 | $lang_time_gap = Context::getLang('time_gap'); |
639 | - if($gap < 60) |
|
639 | + if ($gap < 60) |
|
640 | 640 | { |
641 | 641 | $buff = sprintf($lang_time_gap['min'], (int) ($gap / 60) + 1); |
642 | 642 | } |
643 | - elseif($gap < 60 * 60) |
|
643 | + elseif ($gap < 60 * 60) |
|
644 | 644 | { |
645 | 645 | $buff = sprintf($lang_time_gap['mins'], (int) ($gap / 60) + 1); |
646 | 646 | } |
647 | - elseif($gap < 60 * 60 * 2) |
|
647 | + elseif ($gap < 60 * 60 * 2) |
|
648 | 648 | { |
649 | 649 | $buff = sprintf($lang_time_gap['hour'], (int) ($gap / 60 / 60) + 1); |
650 | 650 | } |
651 | - elseif($gap < 60 * 60 * 24) |
|
651 | + elseif ($gap < 60 * 60 * 24) |
|
652 | 652 | { |
653 | 653 | $buff = sprintf($lang_time_gap['hours'], (int) ($gap / 60 / 60) + 1); |
654 | 654 | } |
@@ -685,40 +685,40 @@ discard block |
||
685 | 685 | function zdate($str, $format = 'Y-m-d H:i:s', $conversion = TRUE) |
686 | 686 | { |
687 | 687 | // return null if no target time is specified |
688 | - if(!$str) |
|
688 | + if (!$str) |
|
689 | 689 | { |
690 | 690 | return; |
691 | 691 | } |
692 | 692 | // convert the date format according to the language |
693 | - if($conversion == TRUE) |
|
693 | + if ($conversion == TRUE) |
|
694 | 694 | { |
695 | - switch(Context::getLangType()) |
|
695 | + switch (Context::getLangType()) |
|
696 | 696 | { |
697 | 697 | case 'en' : |
698 | 698 | case 'es' : |
699 | - if($format == 'Y-m-d') |
|
699 | + if ($format == 'Y-m-d') |
|
700 | 700 | { |
701 | 701 | $format = 'M d, Y'; |
702 | 702 | } |
703 | - elseif($format == 'Y-m-d H:i:s') |
|
703 | + elseif ($format == 'Y-m-d H:i:s') |
|
704 | 704 | { |
705 | 705 | $format = 'M d, Y H:i:s'; |
706 | 706 | } |
707 | - elseif($format == 'Y-m-d H:i') |
|
707 | + elseif ($format == 'Y-m-d H:i') |
|
708 | 708 | { |
709 | 709 | $format = 'M d, Y H:i'; |
710 | 710 | } |
711 | 711 | break; |
712 | 712 | case 'vi' : |
713 | - if($format == 'Y-m-d') |
|
713 | + if ($format == 'Y-m-d') |
|
714 | 714 | { |
715 | 715 | $format = 'd-m-Y'; |
716 | 716 | } |
717 | - elseif($format == 'Y-m-d H:i:s') |
|
717 | + elseif ($format == 'Y-m-d H:i:s') |
|
718 | 718 | { |
719 | 719 | $format = 'H:i:s d-m-Y'; |
720 | 720 | } |
721 | - elseif($format == 'Y-m-d H:i') |
|
721 | + elseif ($format == 'Y-m-d H:i') |
|
722 | 722 | { |
723 | 723 | $format = 'H:i d-m-Y'; |
724 | 724 | } |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | } |
728 | 728 | |
729 | 729 | // If year value is less than 1970, handle it separately. |
730 | - if((int) substr($str, 0, 4) < 1970) |
|
730 | + if ((int) substr($str, 0, 4) < 1970) |
|
731 | 731 | { |
732 | 732 | $hour = (int) substr($str, 8, 2); |
733 | 733 | $min = (int) substr($str, 10, 2); |
@@ -777,9 +777,9 @@ discard block |
||
777 | 777 | function getEncodeEmailAddress($email) |
778 | 778 | { |
779 | 779 | $return = ''; |
780 | - for($i = 0, $c = strlen($email); $i < $c; $i++) |
|
780 | + for ($i = 0, $c = strlen($email); $i < $c; $i++) |
|
781 | 781 | { |
782 | - $return .= '&#' . (rand(0, 1) == 0 ? ord($email[$i]) : 'X' . dechex(ord($email[$i]))) . ';'; |
|
782 | + $return .= '&#'.(rand(0, 1) == 0 ? ord($email[$i]) : 'X'.dechex(ord($email[$i]))).';'; |
|
783 | 783 | } |
784 | 784 | return $return; |
785 | 785 | } |
@@ -800,25 +800,25 @@ discard block |
||
800 | 800 | static $debug_file; |
801 | 801 | static $debug_file_exist; |
802 | 802 | |
803 | - if(!(__DEBUG__ & 1)) |
|
803 | + if (!(__DEBUG__ & 1)) |
|
804 | 804 | { |
805 | 805 | return; |
806 | 806 | } |
807 | 807 | |
808 | 808 | static $firephp; |
809 | 809 | $bt = debug_backtrace(); |
810 | - if(is_array($bt)) |
|
810 | + if (is_array($bt)) |
|
811 | 811 | { |
812 | 812 | $bt_debug_print = array_shift($bt); |
813 | 813 | $bt_called_function = array_shift($bt); |
814 | 814 | } |
815 | 815 | $file_name = str_replace(_XE_PATH_, '', $bt_debug_print['file']); |
816 | 816 | $line_num = $bt_debug_print['line']; |
817 | - $function = $bt_called_function['class'] . $bt_called_function['type'] . $bt_called_function['function']; |
|
817 | + $function = $bt_called_function['class'].$bt_called_function['type'].$bt_called_function['function']; |
|
818 | 818 | |
819 | - if(__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1) |
|
819 | + if (__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1) |
|
820 | 820 | { |
821 | - if(!isset($firephp)) |
|
821 | + if (!isset($firephp)) |
|
822 | 822 | { |
823 | 823 | $firephp = FirePHP::getInstance(TRUE); |
824 | 824 | } |
@@ -827,16 +827,16 @@ discard block |
||
827 | 827 | $label = sprintf('[%s:%d] %s() (Memory usage: current=%s, peak=%s)', $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage()), FileHandler::filesize(memory_get_peak_usage())); |
828 | 828 | |
829 | 829 | // Check a FirePHP option |
830 | - if($display_option === 'TABLE') |
|
830 | + if ($display_option === 'TABLE') |
|
831 | 831 | { |
832 | 832 | $label = $display_option; |
833 | 833 | } |
834 | - if($display_option === 'ERROR') |
|
834 | + if ($display_option === 'ERROR') |
|
835 | 835 | { |
836 | 836 | $type = $display_option; |
837 | 837 | } |
838 | 838 | // Check if the IP specified by __DEBUG_PROTECT__ option is same as the access IP. |
839 | - if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) |
|
839 | + if (__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) |
|
840 | 840 | { |
841 | 841 | $debug_output = 'The IP address is not allowed. Change the value of __DEBUG_PROTECT_IP__ into your IP address in config/config.user.inc.php or config/config.inc.php'; |
842 | 842 | $label = NULL; |
@@ -846,18 +846,18 @@ discard block |
||
846 | 846 | } |
847 | 847 | else |
848 | 848 | { |
849 | - if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) |
|
849 | + if (__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) |
|
850 | 850 | { |
851 | 851 | return; |
852 | 852 | } |
853 | 853 | |
854 | 854 | $print = array(); |
855 | - if($debug_file_exist === NULL) $print[] = '<?php exit() ?>'; |
|
855 | + if ($debug_file_exist === NULL) $print[] = '<?php exit() ?>'; |
|
856 | 856 | |
857 | - if(!$debug_file) $debug_file = _XE_PATH_ . 'files/' . $file; |
|
858 | - if(!$debug_file_exist) $debug_file_exist = file_exists($debug_file); |
|
857 | + if (!$debug_file) $debug_file = _XE_PATH_.'files/'.$file; |
|
858 | + if (!$debug_file_exist) $debug_file_exist = file_exists($debug_file); |
|
859 | 859 | |
860 | - if($display_option === TRUE || $display_option === 'ERROR') |
|
860 | + if ($display_option === TRUE || $display_option === 'ERROR') |
|
861 | 861 | { |
862 | 862 | $print[] = str_repeat('=', 80); |
863 | 863 | } |
@@ -865,10 +865,10 @@ discard block |
||
865 | 865 | $print[] = sprintf("[%s %s:%d] %s() - mem(%s)", date('Y-m-d H:i:s'), $file_name, $line_num, $function, FileHandler::filesize(memory_get_usage())); |
866 | 866 | |
867 | 867 | $type = gettype($debug_output); |
868 | - if(!in_array($type, array('array', 'object', 'resource'))) |
|
868 | + if (!in_array($type, array('array', 'object', 'resource'))) |
|
869 | 869 | { |
870 | - if($display_option === 'ERROR') $print[] = 'ERROR : ' . var_export($debug_output, TRUE); |
|
871 | - else $print[] = $type . '(' . var_export($debug_output, TRUE) . ')'; |
|
870 | + if ($display_option === 'ERROR') $print[] = 'ERROR : '.var_export($debug_output, TRUE); |
|
871 | + else $print[] = $type.'('.var_export($debug_output, TRUE).')'; |
|
872 | 872 | $print[] = PHP_EOL.PHP_EOL; |
873 | 873 | } |
874 | 874 | else |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | $print[] = PHP_EOL; |
878 | 878 | } |
879 | 879 | |
880 | - @file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND|LOCK_EX); |
|
880 | + @file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND | LOCK_EX); |
|
881 | 881 | } |
882 | 882 | } |
883 | 883 | |
@@ -888,7 +888,7 @@ discard block |
||
888 | 888 | */ |
889 | 889 | function writeSlowlog($type, $elapsed_time, $obj) |
890 | 890 | { |
891 | - if(!__LOG_SLOW_TRIGGER__ && !__LOG_SLOW_ADDON__ && !__LOG_SLOW_WIDGET__ && !__LOG_SLOW_QUERY__) return; |
|
891 | + if (!__LOG_SLOW_TRIGGER__ && !__LOG_SLOW_ADDON__ && !__LOG_SLOW_WIDGET__ && !__LOG_SLOW_QUERY__) return; |
|
892 | 892 | |
893 | 893 | static $log_filename = array( |
894 | 894 | 'query' => 'files/_slowlog_query.php', |
@@ -898,47 +898,47 @@ discard block |
||
898 | 898 | ); |
899 | 899 | $write_file = true; |
900 | 900 | |
901 | - $log_file = _XE_PATH_ . $log_filename[$type]; |
|
901 | + $log_file = _XE_PATH_.$log_filename[$type]; |
|
902 | 902 | |
903 | 903 | $buff = array(); |
904 | 904 | $buff[] = '<?php exit(); ?>'; |
905 | 905 | $buff[] = date('c'); |
906 | 906 | |
907 | - if($type == 'trigger' && __LOG_SLOW_TRIGGER__ > 0 && $elapsed_time > __LOG_SLOW_TRIGGER__) |
|
907 | + if ($type == 'trigger' && __LOG_SLOW_TRIGGER__ > 0 && $elapsed_time > __LOG_SLOW_TRIGGER__) |
|
908 | 908 | { |
909 | - $buff[] = "\tCaller : " . $obj->caller; |
|
910 | - $buff[] = "\tCalled : " . $obj->called; |
|
909 | + $buff[] = "\tCaller : ".$obj->caller; |
|
910 | + $buff[] = "\tCalled : ".$obj->called; |
|
911 | 911 | } |
912 | - else if($type == 'addon' && __LOG_SLOW_ADDON__ > 0 && $elapsed_time > __LOG_SLOW_ADDON__) |
|
912 | + else if ($type == 'addon' && __LOG_SLOW_ADDON__ > 0 && $elapsed_time > __LOG_SLOW_ADDON__) |
|
913 | 913 | { |
914 | - $buff[] = "\tAddon : " . $obj->called; |
|
915 | - $buff[] = "\tCalled position : " . $obj->caller; |
|
914 | + $buff[] = "\tAddon : ".$obj->called; |
|
915 | + $buff[] = "\tCalled position : ".$obj->caller; |
|
916 | 916 | } |
917 | - else if($type == 'widget' && __LOG_SLOW_WIDGET__ > 0 && $elapsed_time > __LOG_SLOW_WIDGET__) |
|
917 | + else if ($type == 'widget' && __LOG_SLOW_WIDGET__ > 0 && $elapsed_time > __LOG_SLOW_WIDGET__) |
|
918 | 918 | { |
919 | - $buff[] = "\tWidget : " . $obj->called; |
|
919 | + $buff[] = "\tWidget : ".$obj->called; |
|
920 | 920 | } |
921 | - else if($type == 'query' && __LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__) |
|
921 | + else if ($type == 'query' && __LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__) |
|
922 | 922 | { |
923 | 923 | |
924 | 924 | $buff[] = $obj->query; |
925 | - $buff[] = "\tQuery ID : " . $obj->query_id; |
|
926 | - $buff[] = "\tCaller : " . $obj->caller; |
|
927 | - $buff[] = "\tConnection : " . $obj->connection; |
|
925 | + $buff[] = "\tQuery ID : ".$obj->query_id; |
|
926 | + $buff[] = "\tCaller : ".$obj->caller; |
|
927 | + $buff[] = "\tConnection : ".$obj->connection; |
|
928 | 928 | } |
929 | 929 | else |
930 | 930 | { |
931 | 931 | $write_file = false; |
932 | 932 | } |
933 | 933 | |
934 | - if($write_file) |
|
934 | + if ($write_file) |
|
935 | 935 | { |
936 | 936 | $buff[] = sprintf("\t%0.6f sec", $elapsed_time); |
937 | - $buff[] = PHP_EOL . PHP_EOL; |
|
937 | + $buff[] = PHP_EOL.PHP_EOL; |
|
938 | 938 | file_put_contents($log_file, implode(PHP_EOL, $buff), FILE_APPEND); |
939 | 939 | } |
940 | 940 | |
941 | - if($type != 'query') |
|
941 | + if ($type != 'query') |
|
942 | 942 | { |
943 | 943 | $trigger_args = $obj; |
944 | 944 | $trigger_args->_log_type = $type; |
@@ -978,11 +978,11 @@ discard block |
||
978 | 978 | */ |
979 | 979 | function delObjectVars($target_obj, $del_obj) |
980 | 980 | { |
981 | - if(!is_object($target_obj)) |
|
981 | + if (!is_object($target_obj)) |
|
982 | 982 | { |
983 | 983 | return; |
984 | 984 | } |
985 | - if(!is_object($del_obj)) |
|
985 | + if (!is_object($del_obj)) |
|
986 | 986 | { |
987 | 987 | return; |
988 | 988 | } |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | |
993 | 993 | $target = array_keys($target_vars); |
994 | 994 | $del = array_keys($del_vars); |
995 | - if(!count($target) || !count($del)) |
|
995 | + if (!count($target) || !count($del)) |
|
996 | 996 | { |
997 | 997 | return $target_obj; |
998 | 998 | } |
@@ -1000,10 +1000,10 @@ discard block |
||
1000 | 1000 | $return_obj = new stdClass(); |
1001 | 1001 | |
1002 | 1002 | $target_count = count($target); |
1003 | - for($i = 0; $i < $target_count; $i++) |
|
1003 | + for ($i = 0; $i < $target_count; $i++) |
|
1004 | 1004 | { |
1005 | 1005 | $target_key = $target[$i]; |
1006 | - if(!in_array($target_key, $del)) |
|
1006 | + if (!in_array($target_key, $del)) |
|
1007 | 1007 | { |
1008 | 1008 | $return_obj->{$target_key} = $target_obj->{$target_key}; |
1009 | 1009 | } |
@@ -1016,10 +1016,10 @@ discard block |
||
1016 | 1016 | { |
1017 | 1017 | $del_vars = array('error_return_url', 'success_return_url', 'ruleset', 'xe_validator_id'); |
1018 | 1018 | |
1019 | - foreach($del_vars as $var) |
|
1019 | + foreach ($del_vars as $var) |
|
1020 | 1020 | { |
1021 | - if(is_array($vars)) unset($vars[$var]); |
|
1022 | - else if(is_object($vars)) unset($vars->$var); |
|
1021 | + if (is_array($vars)) unset($vars[$var]); |
|
1022 | + else if (is_object($vars)) unset($vars->$var); |
|
1023 | 1023 | } |
1024 | 1024 | |
1025 | 1025 | return $vars; |
@@ -1036,12 +1036,12 @@ discard block |
||
1036 | 1036 | */ |
1037 | 1037 | function handleError($errno, $errstr, $file, $line) |
1038 | 1038 | { |
1039 | - if(!__DEBUG__) |
|
1039 | + if (!__DEBUG__) |
|
1040 | 1040 | { |
1041 | 1041 | return; |
1042 | 1042 | } |
1043 | 1043 | $errors = array(E_USER_ERROR, E_ERROR, E_PARSE); |
1044 | - if(!in_array($errno, $errors)) |
|
1044 | + if (!in_array($errno, $errors)) |
|
1045 | 1045 | { |
1046 | 1046 | return; |
1047 | 1047 | } |
@@ -1061,8 +1061,8 @@ discard block |
||
1061 | 1061 | function getNumberingPath($no, $size = 3) |
1062 | 1062 | { |
1063 | 1063 | $mod = pow(10, $size); |
1064 | - $output = sprintf('%0' . $size . 'd/', $no % $mod); |
|
1065 | - if($no >= $mod) |
|
1064 | + $output = sprintf('%0'.$size.'d/', $no % $mod); |
|
1065 | + if ($no >= $mod) |
|
1066 | 1066 | { |
1067 | 1067 | $output .= getNumberingPath((int) $no / $mod, $size); |
1068 | 1068 | } |
@@ -1082,7 +1082,7 @@ discard block |
||
1082 | 1082 | |
1083 | 1083 | function purifierHtml(&$content) |
1084 | 1084 | { |
1085 | - require_once(_XE_PATH_ . 'classes/security/Purifier.class.php'); |
|
1085 | + require_once(_XE_PATH_.'classes/security/Purifier.class.php'); |
|
1086 | 1086 | $oPurifier = Purifier::getInstance(); |
1087 | 1087 | $oPurifier->purify($content); |
1088 | 1088 | } |
@@ -1095,7 +1095,7 @@ discard block |
||
1095 | 1095 | */ |
1096 | 1096 | function removeHackTag($content) |
1097 | 1097 | { |
1098 | - require_once(_XE_PATH_ . 'classes/security/EmbedFilter.class.php'); |
|
1098 | + require_once(_XE_PATH_.'classes/security/EmbedFilter.class.php'); |
|
1099 | 1099 | $oEmbedFilter = EmbedFilter::getInstance(); |
1100 | 1100 | $oEmbedFilter->check($content); |
1101 | 1101 | |
@@ -1137,7 +1137,7 @@ discard block |
||
1137 | 1137 | */ |
1138 | 1138 | function checkUploadedFile($file) |
1139 | 1139 | { |
1140 | - require_once(_XE_PATH_ . 'classes/security/UploadFileFilter.class.php'); |
|
1140 | + require_once(_XE_PATH_.'classes/security/UploadFileFilter.class.php'); |
|
1141 | 1141 | return UploadFileFilter::check($file); |
1142 | 1142 | } |
1143 | 1143 | |
@@ -1151,13 +1151,13 @@ discard block |
||
1151 | 1151 | { |
1152 | 1152 | $content = preg_replace('@<(/?)xmp.*?>@i', '<\1xmp>', $content); |
1153 | 1153 | |
1154 | - if(($start_xmp = strrpos($content, '<xmp>')) !== FALSE) |
|
1154 | + if (($start_xmp = strrpos($content, '<xmp>')) !== FALSE) |
|
1155 | 1155 | { |
1156 | - if(($close_xmp = strrpos($content, '</xmp>')) === FALSE) |
|
1156 | + if (($close_xmp = strrpos($content, '</xmp>')) === FALSE) |
|
1157 | 1157 | { |
1158 | 1158 | $content .= '</xmp>'; |
1159 | 1159 | } |
1160 | - else if($close_xmp < $start_xmp) |
|
1160 | + else if ($close_xmp < $start_xmp) |
|
1161 | 1161 | { |
1162 | 1162 | $content .= '</xmp>'; |
1163 | 1163 | } |
@@ -1177,33 +1177,33 @@ discard block |
||
1177 | 1177 | $tag = strtolower($match[2]); |
1178 | 1178 | |
1179 | 1179 | // xmp tag ?뺣━ |
1180 | - if($tag == 'xmp') |
|
1180 | + if ($tag == 'xmp') |
|
1181 | 1181 | { |
1182 | 1182 | return "<{$match[1]}xmp>"; |
1183 | 1183 | } |
1184 | - if($match[1]) |
|
1184 | + if ($match[1]) |
|
1185 | 1185 | { |
1186 | 1186 | return $match[0]; |
1187 | 1187 | } |
1188 | - if($match[4]) |
|
1188 | + if ($match[4]) |
|
1189 | 1189 | { |
1190 | - $match[4] = ' ' . $match[4]; |
|
1190 | + $match[4] = ' '.$match[4]; |
|
1191 | 1191 | } |
1192 | 1192 | |
1193 | 1193 | $attrs = array(); |
1194 | - if(preg_match_all('/([\w:-]+)\s*=(?:\s*(["\']))?(?(2)(.*?)\2|([^ ]+))/s', $match[3], $m)) |
|
1194 | + if (preg_match_all('/([\w:-]+)\s*=(?:\s*(["\']))?(?(2)(.*?)\2|([^ ]+))/s', $match[3], $m)) |
|
1195 | 1195 | { |
1196 | - foreach($m[1] as $idx => $name) |
|
1196 | + foreach ($m[1] as $idx => $name) |
|
1197 | 1197 | { |
1198 | - if(strlen($name) >= 2 && substr_compare($name, 'on', 0, 2) === 0) |
|
1198 | + if (strlen($name) >= 2 && substr_compare($name, 'on', 0, 2) === 0) |
|
1199 | 1199 | { |
1200 | 1200 | continue; |
1201 | 1201 | } |
1202 | 1202 | |
1203 | - $val = preg_replace_callback('/&#(?:x([a-fA-F0-9]+)|0*(\d+));/', function($n) {return chr($n[1] ? ('0x00' . $n[1]) : ($n[2] + 0)); }, $m[3][$idx] . $m[4][$idx]); |
|
1203 | + $val = preg_replace_callback('/&#(?:x([a-fA-F0-9]+)|0*(\d+));/', function($n) {return chr($n[1] ? ('0x00'.$n[1]) : ($n[2] + 0)); }, $m[3][$idx].$m[4][$idx]); |
|
1204 | 1204 | $val = preg_replace('/^\s+|[\t\n\r]+/', '', $val); |
1205 | 1205 | |
1206 | - if(preg_match('/^[a-z]+script:/i', $val)) |
|
1206 | + if (preg_match('/^[a-z]+script:/i', $val)) |
|
1207 | 1207 | { |
1208 | 1208 | continue; |
1209 | 1209 | } |
@@ -1214,60 +1214,60 @@ discard block |
||
1214 | 1214 | |
1215 | 1215 | $filter_arrts = array('style', 'src', 'href'); |
1216 | 1216 | |
1217 | - if($tag === 'object') array_push($filter_arrts, 'data'); |
|
1218 | - if($tag === 'param') array_push($filter_arrts, 'value'); |
|
1217 | + if ($tag === 'object') array_push($filter_arrts, 'data'); |
|
1218 | + if ($tag === 'param') array_push($filter_arrts, 'value'); |
|
1219 | 1219 | |
1220 | - foreach($filter_arrts as $attr) |
|
1220 | + foreach ($filter_arrts as $attr) |
|
1221 | 1221 | { |
1222 | - if(!isset($attrs[$attr])) continue; |
|
1222 | + if (!isset($attrs[$attr])) continue; |
|
1223 | 1223 | |
1224 | 1224 | $attr_value = rawurldecode($attrs[$attr]); |
1225 | 1225 | $attr_value = htmlspecialchars_decode($attr_value, ENT_COMPAT); |
1226 | 1226 | $attr_value = preg_replace('/\s+|[\t\n\r]+/', '', $attr_value); |
1227 | - if(preg_match('@(\?|&|;)(act=(\w+))@i', $attr_value, $m) && $m[3] !== 'procFileDownload') |
|
1227 | + if (preg_match('@(\?|&|;)(act=(\w+))@i', $attr_value, $m) && $m[3] !== 'procFileDownload') |
|
1228 | 1228 | { |
1229 | 1229 | unset($attrs[$attr]); |
1230 | 1230 | } |
1231 | 1231 | } |
1232 | 1232 | |
1233 | - if(isset($attrs['style']) && preg_match('@(?:/\*|\*/|\n|:\s*expression\s*\()@i', $attrs['style'])) |
|
1233 | + if (isset($attrs['style']) && preg_match('@(?:/\*|\*/|\n|:\s*expression\s*\()@i', $attrs['style'])) |
|
1234 | 1234 | { |
1235 | 1235 | unset($attrs['style']); |
1236 | 1236 | } |
1237 | 1237 | |
1238 | 1238 | $attr = array(); |
1239 | - foreach($attrs as $name => $val) |
|
1239 | + foreach ($attrs as $name => $val) |
|
1240 | 1240 | { |
1241 | - if($tag == 'object' || $tag == 'embed' || $tag == 'a') |
|
1241 | + if ($tag == 'object' || $tag == 'embed' || $tag == 'a') |
|
1242 | 1242 | { |
1243 | 1243 | $attribute = strtolower(trim($name)); |
1244 | - if($attribute == 'data' || $attribute == 'src' || $attribute == 'href') |
|
1244 | + if ($attribute == 'data' || $attribute == 'src' || $attribute == 'href') |
|
1245 | 1245 | { |
1246 | - if(stripos($val, 'data:') === 0) |
|
1246 | + if (stripos($val, 'data:') === 0) |
|
1247 | 1247 | { |
1248 | 1248 | continue; |
1249 | 1249 | } |
1250 | 1250 | } |
1251 | 1251 | } |
1252 | 1252 | |
1253 | - if($tag == 'img') |
|
1253 | + if ($tag == 'img') |
|
1254 | 1254 | { |
1255 | 1255 | $attribute = strtolower(trim($name)); |
1256 | - if(stripos($val, 'data:') === 0) |
|
1256 | + if (stripos($val, 'data:') === 0) |
|
1257 | 1257 | { |
1258 | 1258 | continue; |
1259 | 1259 | } |
1260 | 1260 | } |
1261 | 1261 | $val = str_replace('"', '"', $val); |
1262 | - $attr[] = $name . "=\"{$val}\""; |
|
1262 | + $attr[] = $name."=\"{$val}\""; |
|
1263 | 1263 | } |
1264 | - $attr = count($attr) ? ' ' . implode(' ', $attr) : ''; |
|
1264 | + $attr = count($attr) ? ' '.implode(' ', $attr) : ''; |
|
1265 | 1265 | |
1266 | 1266 | return "<{$match[1]}{$tag}{$attr}{$match[4]}>"; |
1267 | 1267 | } |
1268 | 1268 | |
1269 | 1269 | // convert hexa value to RGB |
1270 | -if(!function_exists('hexrgb')) |
|
1270 | +if (!function_exists('hexrgb')) |
|
1271 | 1271 | { |
1272 | 1272 | |
1273 | 1273 | /** |
@@ -1303,9 +1303,9 @@ discard block |
||
1303 | 1303 | |
1304 | 1304 | settype($password, "string"); |
1305 | 1305 | |
1306 | - for($i = 0; $i < strlen($password); $i++) |
|
1306 | + for ($i = 0; $i < strlen($password); $i++) |
|
1307 | 1307 | { |
1308 | - if($password[$i] == ' ' || $password[$i] == '\t') |
|
1308 | + if ($password[$i] == ' ' || $password[$i] == '\t') |
|
1309 | 1309 | { |
1310 | 1310 | continue; |
1311 | 1311 | } |
@@ -1317,11 +1317,11 @@ discard block |
||
1317 | 1317 | $result1 = sprintf("%08lx", $nr & ((1 << 31) - 1)); |
1318 | 1318 | $result2 = sprintf("%08lx", $nr2 & ((1 << 31) - 1)); |
1319 | 1319 | |
1320 | - if($result1 == '80000000') |
|
1320 | + if ($result1 == '80000000') |
|
1321 | 1321 | { |
1322 | 1322 | $nr += 0x80000000; |
1323 | 1323 | } |
1324 | - if($result2 == '80000000') |
|
1324 | + if ($result2 == '80000000') |
|
1325 | 1325 | { |
1326 | 1326 | $nr2 += 0x80000000; |
1327 | 1327 | } |
@@ -1337,7 +1337,7 @@ discard block |
||
1337 | 1337 | function getScriptPath() |
1338 | 1338 | { |
1339 | 1339 | static $url = NULL; |
1340 | - if($url == NULL) |
|
1340 | + if ($url == NULL) |
|
1341 | 1341 | { |
1342 | 1342 | $url = str_ireplace('/tools/', '/', preg_replace('/index.php$/i', '', str_replace('\\', '/', $_SERVER['SCRIPT_NAME']))); |
1343 | 1343 | } |
@@ -1367,14 +1367,14 @@ discard block |
||
1367 | 1367 | $decodedStr = ''; |
1368 | 1368 | $pos = 0; |
1369 | 1369 | $len = strlen($source); |
1370 | - while($pos < $len) |
|
1370 | + while ($pos < $len) |
|
1371 | 1371 | { |
1372 | 1372 | $charAt = substr($source, $pos, 1); |
1373 | - if($charAt == '%') |
|
1373 | + if ($charAt == '%') |
|
1374 | 1374 | { |
1375 | 1375 | $pos++; |
1376 | 1376 | $charAt = substr($source, $pos, 1); |
1377 | - if($charAt == 'u') |
|
1377 | + if ($charAt == 'u') |
|
1378 | 1378 | { |
1379 | 1379 | // we got a unicode character |
1380 | 1380 | $pos++; |
@@ -1408,21 +1408,21 @@ discard block |
||
1408 | 1408 | */ |
1409 | 1409 | function _code2utf($num) |
1410 | 1410 | { |
1411 | - if($num < 128) |
|
1411 | + if ($num < 128) |
|
1412 | 1412 | { |
1413 | 1413 | return chr($num); |
1414 | 1414 | } |
1415 | - if($num < 2048) |
|
1415 | + if ($num < 2048) |
|
1416 | 1416 | { |
1417 | - return chr(($num >> 6) + 192) . chr(($num & 63) + 128); |
|
1417 | + return chr(($num >> 6) + 192).chr(($num & 63) + 128); |
|
1418 | 1418 | } |
1419 | - if($num < 65536) |
|
1419 | + if ($num < 65536) |
|
1420 | 1420 | { |
1421 | - return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); |
|
1421 | + return chr(($num >> 12) + 224).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128); |
|
1422 | 1422 | } |
1423 | - if($num < 2097152) |
|
1423 | + if ($num < 2097152) |
|
1424 | 1424 | { |
1425 | - return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); |
|
1425 | + return chr(($num >> 18) + 240).chr((($num >> 12) & 63) + 128).chr((($num >> 6) & 63) + 128).chr(($num & 63) + 128); |
|
1426 | 1426 | } |
1427 | 1427 | return ''; |
1428 | 1428 | } |
@@ -1437,7 +1437,7 @@ discard block |
||
1437 | 1437 | */ |
1438 | 1438 | function detectUTF8($string, $return_convert = FALSE, $urldecode = TRUE) |
1439 | 1439 | { |
1440 | - if($urldecode) |
|
1440 | + if ($urldecode) |
|
1441 | 1441 | { |
1442 | 1442 | $string = urldecode($string); |
1443 | 1443 | } |
@@ -1445,12 +1445,12 @@ discard block |
||
1445 | 1445 | $sample = iconv('utf-8', 'utf-8', $string); |
1446 | 1446 | $is_utf8 = (md5($sample) === md5($string)); |
1447 | 1447 | |
1448 | - if(!$urldecode) |
|
1448 | + if (!$urldecode) |
|
1449 | 1449 | { |
1450 | 1450 | $string = urldecode($string); |
1451 | 1451 | } |
1452 | 1452 | |
1453 | - if($return_convert) |
|
1453 | + if ($return_convert) |
|
1454 | 1454 | { |
1455 | 1455 | return ($is_utf8) ? $string : iconv('euc-kr', 'utf-8', $string); |
1456 | 1456 | } |
@@ -1466,7 +1466,7 @@ discard block |
||
1466 | 1466 | */ |
1467 | 1467 | function json_encode2($data) |
1468 | 1468 | { |
1469 | - switch(gettype($data)) |
|
1469 | + switch (gettype($data)) |
|
1470 | 1470 | { |
1471 | 1471 | case 'boolean': |
1472 | 1472 | return $data ? 'true' : 'false'; |
@@ -1474,15 +1474,15 @@ discard block |
||
1474 | 1474 | case 'double': |
1475 | 1475 | return $data; |
1476 | 1476 | case 'string': |
1477 | - return '"' . strtr($data, array('\\' => '\\\\', '"' => '\\"')) . '"'; |
|
1477 | + return '"'.strtr($data, array('\\' => '\\\\', '"' => '\\"')).'"'; |
|
1478 | 1478 | case 'object': |
1479 | 1479 | $data = get_object_vars($data); |
1480 | 1480 | case 'array': |
1481 | 1481 | $rel = FALSE; // relative array? |
1482 | 1482 | $key = array_keys($data); |
1483 | - foreach($key as $v) |
|
1483 | + foreach ($key as $v) |
|
1484 | 1484 | { |
1485 | - if(!is_int($v)) |
|
1485 | + if (!is_int($v)) |
|
1486 | 1486 | { |
1487 | 1487 | $rel = TRUE; |
1488 | 1488 | break; |
@@ -1490,12 +1490,12 @@ discard block |
||
1490 | 1490 | } |
1491 | 1491 | |
1492 | 1492 | $arr = array(); |
1493 | - foreach($data as $k => $v) |
|
1493 | + foreach ($data as $k => $v) |
|
1494 | 1494 | { |
1495 | - $arr[] = ($rel ? '"' . strtr($k, array('\\' => '\\\\', '"' => '\\"')) . '":' : '') . json_encode2($v); |
|
1495 | + $arr[] = ($rel ? '"'.strtr($k, array('\\' => '\\\\', '"' => '\\"')).'":' : '').json_encode2($v); |
|
1496 | 1496 | } |
1497 | 1497 | |
1498 | - return $rel ? '{' . join(',', $arr) . '}' : '[' . join(',', $arr) . ']'; |
|
1498 | + return $rel ? '{'.join(',', $arr).'}' : '['.join(',', $arr).']'; |
|
1499 | 1499 | default: |
1500 | 1500 | return '""'; |
1501 | 1501 | } |
@@ -1509,7 +1509,7 @@ discard block |
||
1509 | 1509 | */ |
1510 | 1510 | function isCrawler($agent = NULL) |
1511 | 1511 | { |
1512 | - if(!$agent) |
|
1512 | + if (!$agent) |
|
1513 | 1513 | { |
1514 | 1514 | $agent = $_SERVER['HTTP_USER_AGENT']; |
1515 | 1515 | } |
@@ -1519,9 +1519,9 @@ discard block |
||
1519 | 1519 | /*'211.245.21.110-211.245.21.119' mixsh is closed */ |
1520 | 1520 | ); |
1521 | 1521 | |
1522 | - foreach($check_agent as $str) |
|
1522 | + foreach ($check_agent as $str) |
|
1523 | 1523 | { |
1524 | - if(stristr($agent, $str) != FALSE) |
|
1524 | + if (stristr($agent, $str) != FALSE) |
|
1525 | 1525 | { |
1526 | 1526 | return TRUE; |
1527 | 1527 | } |
@@ -1539,7 +1539,7 @@ discard block |
||
1539 | 1539 | */ |
1540 | 1540 | function stripEmbedTagForAdmin(&$content, $writer_member_srl) |
1541 | 1541 | { |
1542 | - if(!Context::get('is_logged')) |
|
1542 | + if (!Context::get('is_logged')) |
|
1543 | 1543 | { |
1544 | 1544 | return; |
1545 | 1545 | } |
@@ -1547,18 +1547,18 @@ discard block |
||
1547 | 1547 | $oModuleModel = getModel('module'); |
1548 | 1548 | $logged_info = Context::get('logged_info'); |
1549 | 1549 | |
1550 | - if($writer_member_srl != $logged_info->member_srl && ($logged_info->is_admin == "Y" || $oModuleModel->isSiteAdmin($logged_info))) |
|
1550 | + if ($writer_member_srl != $logged_info->member_srl && ($logged_info->is_admin == "Y" || $oModuleModel->isSiteAdmin($logged_info))) |
|
1551 | 1551 | { |
1552 | - if($writer_member_srl) |
|
1552 | + if ($writer_member_srl) |
|
1553 | 1553 | { |
1554 | 1554 | $oMemberModel = getModel('member'); |
1555 | 1555 | $member_info = $oMemberModel->getMemberInfoByMemberSrl($writer_member_srl); |
1556 | - if($member_info->is_admin == "Y") |
|
1556 | + if ($member_info->is_admin == "Y") |
|
1557 | 1557 | { |
1558 | 1558 | return; |
1559 | 1559 | } |
1560 | 1560 | } |
1561 | - $security_msg = "<div style='border: 1px solid #DDD; background: #FAFAFA; text-align:center; margin: 1em 0;'><p style='margin: 1em;'>" . Context::getLang('security_warning_embed') . "</p></div>"; |
|
1561 | + $security_msg = "<div style='border: 1px solid #DDD; background: #FAFAFA; text-align:center; margin: 1em 0;'><p style='margin: 1em;'>".Context::getLang('security_warning_embed')."</p></div>"; |
|
1562 | 1562 | $content = preg_replace('/<object[^>]+>(.*?<\/object>)?/is', $security_msg, $content); |
1563 | 1563 | $content = preg_replace('/<embed[^>]+>(\s*<\/embed>)?/is', $security_msg, $content); |
1564 | 1564 | $content = preg_replace('/<img[^>]+editor_component="multimedia_link"[^>]*>(\s*<\/img>)?/is', $security_msg, $content); |
@@ -1575,18 +1575,18 @@ discard block |
||
1575 | 1575 | function requirePear() |
1576 | 1576 | { |
1577 | 1577 | static $required = false; |
1578 | - if($required) |
|
1578 | + if ($required) |
|
1579 | 1579 | { |
1580 | 1580 | return; |
1581 | 1581 | } |
1582 | 1582 | |
1583 | - if(version_compare(PHP_VERSION, "5.3.0") < 0) |
|
1583 | + if (version_compare(PHP_VERSION, "5.3.0") < 0) |
|
1584 | 1584 | { |
1585 | - set_include_path(_XE_PATH_ . "libs/PEAR" . PATH_SEPARATOR . get_include_path()); |
|
1585 | + set_include_path(_XE_PATH_."libs/PEAR".PATH_SEPARATOR.get_include_path()); |
|
1586 | 1586 | } |
1587 | 1587 | else |
1588 | 1588 | { |
1589 | - set_include_path(_XE_PATH_ . "libs/PEAR.1.9.5" . PATH_SEPARATOR . get_include_path()); |
|
1589 | + set_include_path(_XE_PATH_."libs/PEAR.1.9.5".PATH_SEPARATOR.get_include_path()); |
|
1590 | 1590 | } |
1591 | 1591 | |
1592 | 1592 | $required = true; |
@@ -1594,7 +1594,7 @@ discard block |
||
1594 | 1594 | |
1595 | 1595 | function checkCSRF() |
1596 | 1596 | { |
1597 | - if($_SERVER['REQUEST_METHOD'] != 'POST') |
|
1597 | + if ($_SERVER['REQUEST_METHOD'] != 'POST') |
|
1598 | 1598 | { |
1599 | 1599 | return FALSE; |
1600 | 1600 | } |
@@ -1602,9 +1602,9 @@ discard block |
||
1602 | 1602 | $default_url = Context::getDefaultUrl(); |
1603 | 1603 | $referer = $_SERVER["HTTP_REFERER"]; |
1604 | 1604 | |
1605 | - if(strpos($default_url, 'xn--') !== FALSE && strpos($referer, 'xn--') === FALSE) |
|
1605 | + if (strpos($default_url, 'xn--') !== FALSE && strpos($referer, 'xn--') === FALSE) |
|
1606 | 1606 | { |
1607 | - require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php'); |
|
1607 | + require_once(_XE_PATH_.'libs/idna_convert/idna_convert.class.php'); |
|
1608 | 1608 | $IDN = new idna_convert(array('idn_version' => 2008)); |
1609 | 1609 | $referer = $IDN->encode($referer); |
1610 | 1610 | } |
@@ -1615,9 +1615,9 @@ discard block |
||
1615 | 1615 | $oModuleModel = getModel('module'); |
1616 | 1616 | $siteModuleInfo = $oModuleModel->getDefaultMid(); |
1617 | 1617 | |
1618 | - if($siteModuleInfo->site_srl == 0) |
|
1618 | + if ($siteModuleInfo->site_srl == 0) |
|
1619 | 1619 | { |
1620 | - if($default_url['host'] !== $referer['host']) |
|
1620 | + if ($default_url['host'] !== $referer['host']) |
|
1621 | 1621 | { |
1622 | 1622 | return FALSE; |
1623 | 1623 | } |
@@ -1625,7 +1625,7 @@ discard block |
||
1625 | 1625 | else |
1626 | 1626 | { |
1627 | 1627 | $virtualSiteInfo = $oModuleModel->getSiteInfo($siteModuleInfo->site_srl); |
1628 | - if(strtolower($virtualSiteInfo->domain) != strtolower(Context::get('vid')) && !strstr(strtolower($virtualSiteInfo->domain), strtolower($referer['host']))) |
|
1628 | + if (strtolower($virtualSiteInfo->domain) != strtolower(Context::get('vid')) && !strstr(strtolower($virtualSiteInfo->domain), strtolower($referer['host']))) |
|
1629 | 1629 | { |
1630 | 1630 | return FALSE; |
1631 | 1631 | } |
@@ -1641,15 +1641,15 @@ discard block |
||
1641 | 1641 | */ |
1642 | 1642 | function recurciveExposureCheck(&$menu) |
1643 | 1643 | { |
1644 | - if(is_array($menu)) |
|
1644 | + if (is_array($menu)) |
|
1645 | 1645 | { |
1646 | - foreach($menu AS $key=>$value) |
|
1646 | + foreach ($menu AS $key=>$value) |
|
1647 | 1647 | { |
1648 | - if(!$value['isShow']) |
|
1648 | + if (!$value['isShow']) |
|
1649 | 1649 | { |
1650 | 1650 | unset($menu[$key]); |
1651 | 1651 | } |
1652 | - if(is_array($value['list']) && count($value['list']) > 0) |
|
1652 | + if (is_array($value['list']) && count($value['list']) > 0) |
|
1653 | 1653 | { |
1654 | 1654 | recurciveExposureCheck($menu[$key]['list']); |
1655 | 1655 | } |
@@ -1659,14 +1659,14 @@ discard block |
||
1659 | 1659 | |
1660 | 1660 | function changeValueInUrl($key, $requestKey, $dbKey, $urlName = 'success_return_url') |
1661 | 1661 | { |
1662 | - if($requestKey != $dbKey) |
|
1662 | + if ($requestKey != $dbKey) |
|
1663 | 1663 | { |
1664 | 1664 | $arrayUrl = parse_url(Context::get('success_return_url')); |
1665 | - if($arrayUrl['query']) |
|
1665 | + if ($arrayUrl['query']) |
|
1666 | 1666 | { |
1667 | 1667 | parse_str($arrayUrl['query'], $parsedStr); |
1668 | 1668 | |
1669 | - if(isset($parsedStr[$key])) |
|
1669 | + if (isset($parsedStr[$key])) |
|
1670 | 1670 | { |
1671 | 1671 | $parsedStr[$key] = $requestKey; |
1672 | 1672 | $successReturnUrl .= $arrayUrl['path'].'?'.http_build_query($parsedStr); |
@@ -1709,14 +1709,14 @@ discard block |
||
1709 | 1709 | */ |
1710 | 1710 | function alertScript($msg) |
1711 | 1711 | { |
1712 | - if(!$msg) |
|
1712 | + if (!$msg) |
|
1713 | 1713 | { |
1714 | 1714 | return; |
1715 | 1715 | } |
1716 | 1716 | |
1717 | 1717 | echo '<script type="text/javascript"> |
1718 | 1718 | //<![CDATA[ |
1719 | -alert("' . $msg . '"); |
|
1719 | +alert("' . $msg.'"); |
|
1720 | 1720 | //]]> |
1721 | 1721 | </script>'; |
1722 | 1722 | } |
@@ -1747,7 +1747,7 @@ discard block |
||
1747 | 1747 | |
1748 | 1748 | echo '<script type="text/javascript"> |
1749 | 1749 | //<![CDATA[ |
1750 | -' . $reloadScript . ' |
|
1750 | +' . $reloadScript.' |
|
1751 | 1751 | //]]> |
1752 | 1752 | </script>'; |
1753 | 1753 | } |
@@ -19,11 +19,11 @@ |
||
19 | 19 | { |
20 | 20 | $event = $subject->getLastEvent(); |
21 | 21 | |
22 | - switch($event['name']) |
|
22 | + switch ($event['name']) |
|
23 | 23 | { |
24 | 24 | case 'receivedHeaders': |
25 | 25 | $this->fp = @fopen($this->filename, 'wb'); |
26 | - if(!$this->fp) |
|
26 | + if (!$this->fp) |
|
27 | 27 | { |
28 | 28 | throw new Exception("Cannot open target file '{$filename}'"); |
29 | 29 | } |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | */ |
18 | 18 | function getRealPath($source) |
19 | 19 | { |
20 | - if(strlen($source) >= 2 && substr_compare($source, './', 0, 2) === 0) |
|
20 | + if (strlen($source) >= 2 && substr_compare($source, './', 0, 2) === 0) |
|
21 | 21 | { |
22 | - return _XE_PATH_ . substr($source, 2); |
|
22 | + return _XE_PATH_.substr($source, 2); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | return $source; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | $source_dir = self::getRealPath($source_dir); |
42 | 42 | $target_dir = self::getRealPath($target_dir); |
43 | - if(!is_dir($source_dir)) |
|
43 | + if (!is_dir($source_dir)) |
|
44 | 44 | { |
45 | 45 | return FALSE; |
46 | 46 | } |
@@ -48,44 +48,44 @@ discard block |
||
48 | 48 | // generate when no target exists |
49 | 49 | self::makeDir($target_dir); |
50 | 50 | |
51 | - if(substr($source_dir, -1) != DIRECTORY_SEPARATOR) |
|
51 | + if (substr($source_dir, -1) != DIRECTORY_SEPARATOR) |
|
52 | 52 | { |
53 | 53 | $source_dir .= DIRECTORY_SEPARATOR; |
54 | 54 | } |
55 | 55 | |
56 | - if(substr($target_dir, -1) != DIRECTORY_SEPARATOR) |
|
56 | + if (substr($target_dir, -1) != DIRECTORY_SEPARATOR) |
|
57 | 57 | { |
58 | 58 | $target_dir .= DIRECTORY_SEPARATOR; |
59 | 59 | } |
60 | 60 | |
61 | 61 | $oDir = dir($source_dir); |
62 | - while($file = $oDir->read()) |
|
62 | + while ($file = $oDir->read()) |
|
63 | 63 | { |
64 | - if($file{0} == '.') |
|
64 | + if ($file{0} == '.') |
|
65 | 65 | { |
66 | 66 | continue; |
67 | 67 | } |
68 | 68 | |
69 | - if($filter && preg_match($filter, $file)) |
|
69 | + if ($filter && preg_match($filter, $file)) |
|
70 | 70 | { |
71 | 71 | continue; |
72 | 72 | } |
73 | 73 | |
74 | - if(is_dir($source_dir . $file)) |
|
74 | + if (is_dir($source_dir.$file)) |
|
75 | 75 | { |
76 | - self::copyDir($source_dir . $file, $target_dir . $file, $type); |
|
76 | + self::copyDir($source_dir.$file, $target_dir.$file, $type); |
|
77 | 77 | } |
78 | 78 | else |
79 | 79 | { |
80 | - if($type == 'force') |
|
80 | + if ($type == 'force') |
|
81 | 81 | { |
82 | - @unlink($target_dir . $file); |
|
82 | + @unlink($target_dir.$file); |
|
83 | 83 | } |
84 | 84 | else |
85 | 85 | { |
86 | - if(!file_exists($target_dir . $file)) |
|
86 | + if (!file_exists($target_dir.$file)) |
|
87 | 87 | { |
88 | - @copy($source_dir . $file, $target_dir . $file); |
|
88 | + @copy($source_dir.$file, $target_dir.$file); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | |
111 | 111 | self::makeDir($target_dir); |
112 | 112 | |
113 | - if($force == 'Y') |
|
113 | + if ($force == 'Y') |
|
114 | 114 | { |
115 | - @unlink($target_dir . DIRECTORY_SEPARATOR . $target); |
|
115 | + @unlink($target_dir.DIRECTORY_SEPARATOR.$target); |
|
116 | 116 | } |
117 | 117 | |
118 | - @copy($source, $target_dir . DIRECTORY_SEPARATOR . $target); |
|
118 | + @copy($source, $target_dir.DIRECTORY_SEPARATOR.$target); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | function readFile($filename) |
128 | 128 | { |
129 | - if(($filename = self::exists($filename)) === FALSE || filesize($filename) < 1) |
|
129 | + if (($filename = self::exists($filename)) === FALSE || filesize($filename) < 1) |
|
130 | 130 | { |
131 | 131 | return; |
132 | 132 | } |
@@ -149,12 +149,12 @@ discard block |
||
149 | 149 | self::makeDir($pathinfo['dirname']); |
150 | 150 | |
151 | 151 | $flags = 0; |
152 | - if(strtolower($mode) == 'a') |
|
152 | + if (strtolower($mode) == 'a') |
|
153 | 153 | { |
154 | 154 | $flags = FILE_APPEND; |
155 | 155 | } |
156 | 156 | |
157 | - @file_put_contents($filename, $buff, $flags|LOCK_EX); |
|
157 | + @file_put_contents($filename, $buff, $flags | LOCK_EX); |
|
158 | 158 | @chmod($filename, 0644); |
159 | 159 | } |
160 | 160 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | function moveFile($source, $target) |
194 | 194 | { |
195 | - if(($source = self::exists($source)) !== FALSE) |
|
195 | + if (($source = self::exists($source)) !== FALSE) |
|
196 | 196 | { |
197 | 197 | self::removeFile($target); |
198 | 198 | return self::rename($source, $target); |
@@ -230,35 +230,35 @@ discard block |
||
230 | 230 | $path = self::getRealPath($path); |
231 | 231 | $output = array(); |
232 | 232 | |
233 | - if(substr($path, -1) != '/') |
|
233 | + if (substr($path, -1) != '/') |
|
234 | 234 | { |
235 | 235 | $path .= '/'; |
236 | 236 | } |
237 | 237 | |
238 | - if(!is_dir($path)) |
|
238 | + if (!is_dir($path)) |
|
239 | 239 | { |
240 | 240 | return $output; |
241 | 241 | } |
242 | 242 | |
243 | 243 | $files = scandir($path); |
244 | - foreach($files as $file) |
|
244 | + foreach ($files as $file) |
|
245 | 245 | { |
246 | - if($file{0} == '.' || ($filter && !preg_match($filter, $file))) |
|
246 | + if ($file{0} == '.' || ($filter && !preg_match($filter, $file))) |
|
247 | 247 | { |
248 | 248 | continue; |
249 | 249 | } |
250 | 250 | |
251 | - if($to_lower) |
|
251 | + if ($to_lower) |
|
252 | 252 | { |
253 | 253 | $file = strtolower($file); |
254 | 254 | } |
255 | 255 | |
256 | - if($filter) |
|
256 | + if ($filter) |
|
257 | 257 | { |
258 | 258 | $file = preg_replace($filter, '$1', $file); |
259 | 259 | } |
260 | 260 | |
261 | - if($concat_prefix) |
|
261 | + if ($concat_prefix) |
|
262 | 262 | { |
263 | 263 | $file = sprintf('%s%s', str_replace(_XE_PATH_, '', $path), $file); |
264 | 264 | } |
@@ -279,12 +279,12 @@ discard block |
||
279 | 279 | */ |
280 | 280 | function makeDir($path_string) |
281 | 281 | { |
282 | - if(self::exists($path_string) !== FALSE) |
|
282 | + if (self::exists($path_string) !== FALSE) |
|
283 | 283 | { |
284 | 284 | return TRUE; |
285 | 285 | } |
286 | 286 | |
287 | - if(!ini_get('safe_mode')) |
|
287 | + if (!ini_get('safe_mode')) |
|
288 | 288 | { |
289 | 289 | @mkdir($path_string, 0755, TRUE); |
290 | 290 | @chmod($path_string, 0755); |
@@ -295,35 +295,35 @@ discard block |
||
295 | 295 | static $oFtp = NULL; |
296 | 296 | |
297 | 297 | $ftp_info = Context::getFTPInfo(); |
298 | - if($oFtp == NULL) |
|
298 | + if ($oFtp == NULL) |
|
299 | 299 | { |
300 | - if(!Context::isFTPRegisted()) |
|
300 | + if (!Context::isFTPRegisted()) |
|
301 | 301 | { |
302 | 302 | return; |
303 | 303 | } |
304 | 304 | |
305 | - require_once(_XE_PATH_ . 'libs/ftp.class.php'); |
|
305 | + require_once(_XE_PATH_.'libs/ftp.class.php'); |
|
306 | 306 | $oFtp = new ftp(); |
307 | - if(!$ftp_info->ftp_host) |
|
307 | + if (!$ftp_info->ftp_host) |
|
308 | 308 | { |
309 | 309 | $ftp_info->ftp_host = "127.0.0.1"; |
310 | 310 | } |
311 | - if(!$ftp_info->ftp_port) |
|
311 | + if (!$ftp_info->ftp_port) |
|
312 | 312 | { |
313 | 313 | $ftp_info->ftp_port = 21; |
314 | 314 | } |
315 | - if(!$oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) |
|
315 | + if (!$oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) |
|
316 | 316 | { |
317 | 317 | return; |
318 | 318 | } |
319 | - if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
319 | + if (!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) |
|
320 | 320 | { |
321 | 321 | $oFtp->ftp_quit(); |
322 | 322 | return; |
323 | 323 | } |
324 | 324 | } |
325 | 325 | |
326 | - if(!($ftp_path = $ftp_info->ftp_root_path)) |
|
326 | + if (!($ftp_path = $ftp_info->ftp_root_path)) |
|
327 | 327 | { |
328 | 328 | $ftp_path = DIRECTORY_SEPARATOR; |
329 | 329 | } |
@@ -332,19 +332,19 @@ discard block |
||
332 | 332 | $path_list = explode(DIRECTORY_SEPARATOR, $path_string); |
333 | 333 | |
334 | 334 | $path = _XE_PATH_; |
335 | - for($i = 0, $c = count($path_list); $i < $c; $i++) |
|
335 | + for ($i = 0, $c = count($path_list); $i < $c; $i++) |
|
336 | 336 | { |
337 | - if(!$path_list[$i]) |
|
337 | + if (!$path_list[$i]) |
|
338 | 338 | { |
339 | 339 | continue; |
340 | 340 | } |
341 | 341 | |
342 | - $path .= $path_list[$i] . DIRECTORY_SEPARATOR; |
|
343 | - $ftp_path .= $path_list[$i] . DIRECTORY_SEPARATOR; |
|
344 | - if(!is_dir($path)) |
|
342 | + $path .= $path_list[$i].DIRECTORY_SEPARATOR; |
|
343 | + $ftp_path .= $path_list[$i].DIRECTORY_SEPARATOR; |
|
344 | + if (!is_dir($path)) |
|
345 | 345 | { |
346 | 346 | $oFtp->ftp_mkdir($ftp_path); |
347 | - $oFtp->ftp_site("CHMOD 777 " . $ftp_path); |
|
347 | + $oFtp->ftp_site("CHMOD 777 ".$ftp_path); |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | } |
@@ -360,23 +360,23 @@ discard block |
||
360 | 360 | */ |
361 | 361 | function removeDir($path) |
362 | 362 | { |
363 | - if(($path = self::isDir($path)) === FALSE) |
|
363 | + if (($path = self::isDir($path)) === FALSE) |
|
364 | 364 | { |
365 | 365 | return; |
366 | 366 | } |
367 | 367 | |
368 | - if(self::isDir($path)) |
|
368 | + if (self::isDir($path)) |
|
369 | 369 | { |
370 | 370 | $files = array_diff(scandir($path), array('..', '.')); |
371 | 371 | |
372 | - foreach($files as $file) |
|
372 | + foreach ($files as $file) |
|
373 | 373 | { |
374 | - if(($target = self::getRealPath($path . DIRECTORY_SEPARATOR . $file)) === FALSE) |
|
374 | + if (($target = self::getRealPath($path.DIRECTORY_SEPARATOR.$file)) === FALSE) |
|
375 | 375 | { |
376 | 376 | continue; |
377 | 377 | } |
378 | 378 | |
379 | - if(is_dir($target)) |
|
379 | + if (is_dir($target)) |
|
380 | 380 | { |
381 | 381 | self::removeDir($target); |
382 | 382 | } |
@@ -401,22 +401,22 @@ discard block |
||
401 | 401 | */ |
402 | 402 | function removeBlankDir($path) |
403 | 403 | { |
404 | - if(($path = self::isDir($path)) === FALSE) |
|
404 | + if (($path = self::isDir($path)) === FALSE) |
|
405 | 405 | { |
406 | 406 | return; |
407 | 407 | } |
408 | 408 | |
409 | 409 | $files = array_diff(scandir($path), array('..', '.')); |
410 | 410 | |
411 | - if(count($files) < 1) |
|
411 | + if (count($files) < 1) |
|
412 | 412 | { |
413 | 413 | rmdir($path); |
414 | 414 | return; |
415 | 415 | } |
416 | 416 | |
417 | - foreach($files as $file) |
|
417 | + foreach ($files as $file) |
|
418 | 418 | { |
419 | - if(($target = self::isDir($path . DIRECTORY_SEPARATOR . $file)) === FALSE) |
|
419 | + if (($target = self::isDir($path.DIRECTORY_SEPARATOR.$file)) === FALSE) |
|
420 | 420 | { |
421 | 421 | continue; |
422 | 422 | } |
@@ -435,23 +435,23 @@ discard block |
||
435 | 435 | */ |
436 | 436 | function removeFilesInDir($path) |
437 | 437 | { |
438 | - if(($path = self::getRealPath($path)) === FALSE) |
|
438 | + if (($path = self::getRealPath($path)) === FALSE) |
|
439 | 439 | { |
440 | 440 | return; |
441 | 441 | } |
442 | 442 | |
443 | - if(is_dir($path)) |
|
443 | + if (is_dir($path)) |
|
444 | 444 | { |
445 | 445 | $files = array_diff(scandir($path), array('..', '.')); |
446 | 446 | |
447 | - foreach($files as $file) |
|
447 | + foreach ($files as $file) |
|
448 | 448 | { |
449 | - if(($target = self::getRealPath($path . DIRECTORY_SEPARATOR . $file)) === FALSE) |
|
449 | + if (($target = self::getRealPath($path.DIRECTORY_SEPARATOR.$file)) === FALSE) |
|
450 | 450 | { |
451 | 451 | continue; |
452 | 452 | } |
453 | 453 | |
454 | - if(is_dir($target)) |
|
454 | + if (is_dir($target)) |
|
455 | 455 | { |
456 | 456 | self::removeFilesInDir($target); |
457 | 457 | } |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | } |
464 | 464 | else |
465 | 465 | { |
466 | - if(self::exists($path)) unlink($path); |
|
466 | + if (self::exists($path)) unlink($path); |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | } |
@@ -477,22 +477,22 @@ discard block |
||
477 | 477 | */ |
478 | 478 | function filesize($size) |
479 | 479 | { |
480 | - if(!$size) |
|
480 | + if (!$size) |
|
481 | 481 | { |
482 | 482 | return '0Byte'; |
483 | 483 | } |
484 | 484 | |
485 | - if($size === 1) |
|
485 | + if ($size === 1) |
|
486 | 486 | { |
487 | 487 | return '1Byte'; |
488 | 488 | } |
489 | 489 | |
490 | - if($size < 1024) |
|
490 | + if ($size < 1024) |
|
491 | 491 | { |
492 | - return $size . 'Bytes'; |
|
492 | + return $size.'Bytes'; |
|
493 | 493 | } |
494 | 494 | |
495 | - if($size >= 1024 && $size < 1024 * 1024) |
|
495 | + if ($size >= 1024 && $size < 1024 * 1024) |
|
496 | 496 | { |
497 | 497 | return sprintf("%0.1fKB", $size / 1024); |
498 | 498 | } |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | */ |
518 | 518 | function getRemoteResource($url, $body = null, $timeout = 3, $method = 'GET', $content_type = null, $headers = array(), $cookies = array(), $post_data = array(), $request_config = array()) |
519 | 519 | { |
520 | - require_once(_XE_PATH_ . 'libs/idna_convert/idna_convert.class.php'); |
|
520 | + require_once(_XE_PATH_.'libs/idna_convert/idna_convert.class.php'); |
|
521 | 521 | $IDN = new idna_convert(array('idn_version' => 2008)); |
522 | 522 | $url = $IDN->encode($url); |
523 | 523 | |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | require_once('HTTP/Request.php'); |
528 | 528 | |
529 | 529 | $parsed_url = parse_url(__PROXY_SERVER__); |
530 | - if($parsed_url["host"]) |
|
530 | + if ($parsed_url["host"]) |
|
531 | 531 | { |
532 | 532 | $oRequest = new HTTP_Request(__PROXY_SERVER__); |
533 | 533 | $oRequest->setMethod('POST'); |
@@ -537,13 +537,13 @@ discard block |
||
537 | 537 | { |
538 | 538 | $oRequest = new HTTP_Request($url); |
539 | 539 | |
540 | - if(count($request_config) && method_exists($oRequest, 'setConfig')) |
|
540 | + if (count($request_config) && method_exists($oRequest, 'setConfig')) |
|
541 | 541 | { |
542 | - foreach($request_config as $key=>$val) |
|
542 | + foreach ($request_config as $key=>$val) |
|
543 | 543 | { |
544 | - if($key === 'observers') |
|
544 | + if ($key === 'observers') |
|
545 | 545 | { |
546 | - foreach($val as $observer) |
|
546 | + foreach ($val as $observer) |
|
547 | 547 | { |
548 | 548 | $oRequest->attach($observer); |
549 | 549 | } |
@@ -555,41 +555,41 @@ discard block |
||
555 | 555 | } |
556 | 556 | } |
557 | 557 | |
558 | - if(count($headers) > 0) |
|
558 | + if (count($headers) > 0) |
|
559 | 559 | { |
560 | - foreach($headers as $key => $val) |
|
560 | + foreach ($headers as $key => $val) |
|
561 | 561 | { |
562 | 562 | $oRequest->addHeader($key, $val); |
563 | 563 | } |
564 | 564 | } |
565 | - if($cookies[$host]) |
|
565 | + if ($cookies[$host]) |
|
566 | 566 | { |
567 | - foreach($cookies[$host] as $key => $val) |
|
567 | + foreach ($cookies[$host] as $key => $val) |
|
568 | 568 | { |
569 | 569 | $oRequest->addCookie($key, $val); |
570 | 570 | } |
571 | 571 | } |
572 | - if(count($post_data) > 0) |
|
572 | + if (count($post_data) > 0) |
|
573 | 573 | { |
574 | - foreach($post_data as $key => $val) |
|
574 | + foreach ($post_data as $key => $val) |
|
575 | 575 | { |
576 | 576 | $oRequest->addPostData($key, $val); |
577 | 577 | } |
578 | 578 | } |
579 | - if(!$content_type) |
|
579 | + if (!$content_type) |
|
580 | 580 | $oRequest->addHeader('Content-Type', 'text/html'); |
581 | 581 | else |
582 | 582 | $oRequest->addHeader('Content-Type', $content_type); |
583 | 583 | $oRequest->setMethod($method); |
584 | - if($body) |
|
584 | + if ($body) |
|
585 | 585 | $oRequest->setBody($body); |
586 | 586 | } |
587 | 587 | |
588 | - if(method_exists($oRequest, 'setConfig')) |
|
588 | + if (method_exists($oRequest, 'setConfig')) |
|
589 | 589 | { |
590 | 590 | $oRequest->setConfig('timeout', $timeout); |
591 | 591 | } |
592 | - elseif(property_exists($oRequest, '_timeout')) |
|
592 | + elseif (property_exists($oRequest, '_timeout')) |
|
593 | 593 | { |
594 | 594 | $oRequest->_timeout = $timeout; |
595 | 595 | } |
@@ -599,25 +599,25 @@ discard block |
||
599 | 599 | $code = $oRequest->getResponseCode(); |
600 | 600 | $header = $oRequest->getResponseHeader(); |
601 | 601 | $response = $oRequest->getResponseBody(); |
602 | - if($c = $oRequest->getResponseCookies()) |
|
602 | + if ($c = $oRequest->getResponseCookies()) |
|
603 | 603 | { |
604 | - foreach($c as $k => $v) |
|
604 | + foreach ($c as $k => $v) |
|
605 | 605 | { |
606 | 606 | $cookies[$host][$v['name']] = $v['value']; |
607 | 607 | } |
608 | 608 | } |
609 | 609 | |
610 | - if($code > 300 && $code < 399 && $header['location']) |
|
610 | + if ($code > 300 && $code < 399 && $header['location']) |
|
611 | 611 | { |
612 | 612 | return self::getRemoteResource($header['location'], $body, $timeout, $method, $content_type, $headers, $cookies, $post_data); |
613 | 613 | } |
614 | 614 | |
615 | - if($code != 200) |
|
615 | + if ($code != 200) |
|
616 | 616 | { |
617 | 617 | return; |
618 | 618 | } |
619 | 619 | |
620 | - if(isset($request_config['store_body']) && !$request_config['store_body']) |
|
620 | + if (isset($request_config['store_body']) && !$request_config['store_body']) |
|
621 | 621 | { |
622 | 622 | return TRUE; |
623 | 623 | } |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | return $response; |
627 | 627 | } |
628 | 628 | } |
629 | - catch(Exception $e) |
|
629 | + catch (Exception $e) |
|
630 | 630 | { |
631 | 631 | return NULL; |
632 | 632 | } |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | { |
659 | 659 | $result = self::getRemoteResource($url, $body, $timeout, $method, $content_type, $headers, $cookies, $post_data, $request_config); |
660 | 660 | } |
661 | - catch(Exception $e) |
|
661 | + catch (Exception $e) |
|
662 | 662 | { |
663 | 663 | return FALSE; |
664 | 664 | } |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | function returnBytes($val) |
676 | 676 | { |
677 | 677 | $unit = strtoupper(substr($val, -1)); |
678 | - $val = (float)$val; |
|
678 | + $val = (float) $val; |
|
679 | 679 | |
680 | 680 | switch ($unit) |
681 | 681 | { |
@@ -698,13 +698,13 @@ discard block |
||
698 | 698 | $K64 = 65536; |
699 | 699 | $TWEAKFACTOR = 2.0; |
700 | 700 | $channels = $imageInfo['channels']; |
701 | - if(!$channels) |
|
701 | + if (!$channels) |
|
702 | 702 | { |
703 | 703 | $channels = 6; //for png |
704 | 704 | } |
705 | - $memoryNeeded = round(($imageInfo[0] * $imageInfo[1] * $imageInfo['bits'] * $channels / 8 + $K64 ) * $TWEAKFACTOR); |
|
705 | + $memoryNeeded = round(($imageInfo[0] * $imageInfo[1] * $imageInfo['bits'] * $channels / 8 + $K64) * $TWEAKFACTOR); |
|
706 | 706 | $availableMemory = self::returnBytes(ini_get('memory_limit')) - memory_get_usage(); |
707 | - if($availableMemory < $memoryNeeded) |
|
707 | + if ($availableMemory < $memoryNeeded) |
|
708 | 708 | { |
709 | 709 | return FALSE; |
710 | 710 | } |
@@ -731,30 +731,30 @@ discard block |
||
731 | 731 | } |
732 | 732 | |
733 | 733 | $target_file = self::getRealPath($target_file); |
734 | - if(!$resize_width) |
|
734 | + if (!$resize_width) |
|
735 | 735 | { |
736 | 736 | $resize_width = 100; |
737 | 737 | } |
738 | 738 | |
739 | - if(!$resize_height) |
|
739 | + if (!$resize_height) |
|
740 | 740 | { |
741 | 741 | $resize_height = $resize_width; |
742 | 742 | } |
743 | 743 | |
744 | 744 | // retrieve source image's information |
745 | 745 | $imageInfo = getimagesize($source_file); |
746 | - if(!self::checkMemoryLoadImage($imageInfo)) |
|
746 | + if (!self::checkMemoryLoadImage($imageInfo)) |
|
747 | 747 | { |
748 | 748 | return FALSE; |
749 | 749 | } |
750 | 750 | |
751 | 751 | list($width, $height, $type, $attrs) = $imageInfo; |
752 | - if($width < 1 || $height < 1) |
|
752 | + if ($width < 1 || $height < 1) |
|
753 | 753 | { |
754 | 754 | return; |
755 | 755 | } |
756 | 756 | |
757 | - switch($type) |
|
757 | + switch ($type) |
|
758 | 758 | { |
759 | 759 | case '1' : |
760 | 760 | $type = 'gif'; |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | return; |
773 | 773 | } |
774 | 774 | |
775 | - if(!$target_type) |
|
775 | + if (!$target_type) |
|
776 | 776 | { |
777 | 777 | $target_type = $type; |
778 | 778 | } |
@@ -783,7 +783,7 @@ discard block |
||
783 | 783 | $height_per = ($resize_height > 0 && $height >= $resize_height) ? $resize_height / $height : 1; |
784 | 784 | |
785 | 785 | $per = NULL; |
786 | - if($thumbnail_type == 'ratio') |
|
786 | + if ($thumbnail_type == 'ratio') |
|
787 | 787 | { |
788 | 788 | $per = ($width_per > $height_per) ? $height_per : $width_per; |
789 | 789 | $resize_width = $width * $per; |
@@ -796,16 +796,16 @@ discard block |
||
796 | 796 | |
797 | 797 | // create temporary image with target size |
798 | 798 | $thumb = NULL; |
799 | - if(function_exists('imagecreateTRUEcolor')) |
|
799 | + if (function_exists('imagecreateTRUEcolor')) |
|
800 | 800 | { |
801 | 801 | $thumb = imagecreateTRUEcolor($resize_width, $resize_height); |
802 | 802 | } |
803 | - else if(function_exists('imagecreate')) |
|
803 | + else if (function_exists('imagecreate')) |
|
804 | 804 | { |
805 | 805 | $thumb = imagecreate($resize_width, $resize_height); |
806 | 806 | } |
807 | 807 | |
808 | - if(!$thumb) |
|
808 | + if (!$thumb) |
|
809 | 809 | { |
810 | 810 | return FALSE; |
811 | 811 | } |
@@ -814,37 +814,37 @@ discard block |
||
814 | 814 | |
815 | 815 | // create temporary image having original type |
816 | 816 | $source = NULL; |
817 | - switch($type) |
|
817 | + switch ($type) |
|
818 | 818 | { |
819 | 819 | case 'gif' : |
820 | - if(function_exists('imagecreatefromgif')) |
|
820 | + if (function_exists('imagecreatefromgif')) |
|
821 | 821 | { |
822 | 822 | $source = @imagecreatefromgif($source_file); |
823 | 823 | } |
824 | 824 | break; |
825 | 825 | case 'jpeg' : |
826 | 826 | case 'jpg' : |
827 | - if(function_exists('imagecreatefromjpeg')) |
|
827 | + if (function_exists('imagecreatefromjpeg')) |
|
828 | 828 | { |
829 | 829 | $source = @imagecreatefromjpeg($source_file); |
830 | 830 | } |
831 | 831 | break; |
832 | 832 | case 'png' : |
833 | - if(function_exists('imagecreatefrompng')) |
|
833 | + if (function_exists('imagecreatefrompng')) |
|
834 | 834 | { |
835 | 835 | $source = @imagecreatefrompng($source_file); |
836 | 836 | } |
837 | 837 | break; |
838 | 838 | case 'wbmp' : |
839 | 839 | case 'bmp' : |
840 | - if(function_exists('imagecreatefromwbmp')) |
|
840 | + if (function_exists('imagecreatefromwbmp')) |
|
841 | 841 | { |
842 | 842 | $source = @imagecreatefromwbmp($source_file); |
843 | 843 | } |
844 | 844 | break; |
845 | 845 | } |
846 | 846 | |
847 | - if(!$source) |
|
847 | + if (!$source) |
|
848 | 848 | { |
849 | 849 | imagedestroy($thumb); |
850 | 850 | return FALSE; |
@@ -856,13 +856,13 @@ discard block |
||
856 | 856 | |
857 | 857 | $x = 0; |
858 | 858 | $y = 0; |
859 | - if($thumbnail_type == 'crop') |
|
859 | + if ($thumbnail_type == 'crop') |
|
860 | 860 | { |
861 | 861 | $x = (int) ($resize_width / 2 - $new_width / 2); |
862 | 862 | $y = (int) ($resize_height / 2 - $new_height / 2); |
863 | 863 | } |
864 | 864 | |
865 | - if(function_exists('imagecopyresampled')) |
|
865 | + if (function_exists('imagecopyresampled')) |
|
866 | 866 | { |
867 | 867 | imagecopyresampled($thumb, $source, $x, $y, 0, 0, $new_width, $new_height, $width, $height); |
868 | 868 | } |
@@ -876,30 +876,30 @@ discard block |
||
876 | 876 | |
877 | 877 | // write into the file |
878 | 878 | $output = NULL; |
879 | - switch($target_type) |
|
879 | + switch ($target_type) |
|
880 | 880 | { |
881 | 881 | case 'gif' : |
882 | - if(function_exists('imagegif')) |
|
882 | + if (function_exists('imagegif')) |
|
883 | 883 | { |
884 | 884 | $output = imagegif($thumb, $target_file); |
885 | 885 | } |
886 | 886 | break; |
887 | 887 | case 'jpeg' : |
888 | 888 | case 'jpg' : |
889 | - if(function_exists('imagejpeg')) |
|
889 | + if (function_exists('imagejpeg')) |
|
890 | 890 | { |
891 | 891 | $output = imagejpeg($thumb, $target_file, 100); |
892 | 892 | } |
893 | 893 | break; |
894 | 894 | case 'png' : |
895 | - if(function_exists('imagepng')) |
|
895 | + if (function_exists('imagepng')) |
|
896 | 896 | { |
897 | 897 | $output = imagepng($thumb, $target_file, 9); |
898 | 898 | } |
899 | 899 | break; |
900 | 900 | case 'wbmp' : |
901 | 901 | case 'bmp' : |
902 | - if(function_exists('imagewbmp')) |
|
902 | + if (function_exists('imagewbmp')) |
|
903 | 903 | { |
904 | 904 | $output = imagewbmp($thumb, $target_file, 100); |
905 | 905 | } |
@@ -909,7 +909,7 @@ discard block |
||
909 | 909 | imagedestroy($thumb); |
910 | 910 | imagedestroy($source); |
911 | 911 | |
912 | - if(!$output) |
|
912 | + if (!$output) |
|
913 | 913 | { |
914 | 914 | return FALSE; |
915 | 915 | } |
@@ -927,12 +927,12 @@ discard block |
||
927 | 927 | */ |
928 | 928 | function readIniFile($filename) |
929 | 929 | { |
930 | - if(($filename = self::exists($filename)) === FALSE) |
|
930 | + if (($filename = self::exists($filename)) === FALSE) |
|
931 | 931 | { |
932 | 932 | return FALSE; |
933 | 933 | } |
934 | 934 | $arr = parse_ini_file($filename, TRUE); |
935 | - if(is_array($arr) && count($arr) > 0) |
|
935 | + if (is_array($arr) && count($arr) > 0) |
|
936 | 936 | { |
937 | 937 | return $arr; |
938 | 938 | } |
@@ -958,7 +958,7 @@ discard block |
||
958 | 958 | */ |
959 | 959 | function writeIniFile($filename, $arr) |
960 | 960 | { |
961 | - if(!is_array($arr) || count($arr) == 0) |
|
961 | + if (!is_array($arr) || count($arr) == 0) |
|
962 | 962 | { |
963 | 963 | return FALSE; |
964 | 964 | } |
@@ -975,19 +975,19 @@ discard block |
||
975 | 975 | function _makeIniBuff($arr) |
976 | 976 | { |
977 | 977 | $return = array(); |
978 | - foreach($arr as $key => $val) |
|
978 | + foreach ($arr as $key => $val) |
|
979 | 979 | { |
980 | 980 | // section |
981 | - if(is_array($val)) |
|
981 | + if (is_array($val)) |
|
982 | 982 | { |
983 | 983 | $return[] = sprintf("[%s]", $key); |
984 | - foreach($val as $k => $v) |
|
984 | + foreach ($val as $k => $v) |
|
985 | 985 | { |
986 | 986 | $return[] = sprintf("%s=\"%s\"", $k, $v); |
987 | 987 | } |
988 | 988 | // value |
989 | 989 | } |
990 | - else if(is_object($val)) |
|
990 | + else if (is_object($val)) |
|
991 | 991 | { |
992 | 992 | continue; |
993 | 993 | } |
@@ -1062,15 +1062,15 @@ discard block |
||
1062 | 1062 | function isWritableDir($path) |
1063 | 1063 | { |
1064 | 1064 | $path = self::getRealPath($path); |
1065 | - if(is_dir($path)==FALSE) |
|
1065 | + if (is_dir($path) == FALSE) |
|
1066 | 1066 | { |
1067 | 1067 | return FALSE; |
1068 | 1068 | } |
1069 | 1069 | |
1070 | - $checkFile = $path . '/_CheckWritableDir'; |
|
1070 | + $checkFile = $path.'/_CheckWritableDir'; |
|
1071 | 1071 | |
1072 | 1072 | $fp = fopen($checkFile, 'w'); |
1073 | - if(!is_resource($fp)) |
|
1073 | + if (!is_resource($fp)) |
|
1074 | 1074 | { |
1075 | 1075 | return FALSE; |
1076 | 1076 | } |
@@ -74,14 +74,12 @@ discard block |
||
74 | 74 | if(is_dir($source_dir . $file)) |
75 | 75 | { |
76 | 76 | self::copyDir($source_dir . $file, $target_dir . $file, $type); |
77 | - } |
|
78 | - else |
|
77 | + } else |
|
79 | 78 | { |
80 | 79 | if($type == 'force') |
81 | 80 | { |
82 | 81 | @unlink($target_dir . $file); |
83 | - } |
|
84 | - else |
|
82 | + } else |
|
85 | 83 | { |
86 | 84 | if(!file_exists($target_dir . $file)) |
87 | 85 | { |
@@ -379,15 +377,13 @@ discard block |
||
379 | 377 | if(is_dir($target)) |
380 | 378 | { |
381 | 379 | self::removeDir($target); |
382 | - } |
|
383 | - else |
|
380 | + } else |
|
384 | 381 | { |
385 | 382 | unlink($target); |
386 | 383 | } |
387 | 384 | } |
388 | 385 | rmdir($path); |
389 | - } |
|
390 | - else |
|
386 | + } else |
|
391 | 387 | { |
392 | 388 | unlink($path); |
393 | 389 | } |
@@ -454,16 +450,16 @@ discard block |
||
454 | 450 | if(is_dir($target)) |
455 | 451 | { |
456 | 452 | self::removeFilesInDir($target); |
457 | - } |
|
458 | - else |
|
453 | + } else |
|
459 | 454 | { |
460 | 455 | unlink($target); |
461 | 456 | } |
462 | 457 | } |
463 | - } |
|
464 | - else |
|
458 | + } else |
|
465 | 459 | { |
466 | - if(self::exists($path)) unlink($path); |
|
460 | + if(self::exists($path)) { |
|
461 | + unlink($path); |
|
462 | + } |
|
467 | 463 | } |
468 | 464 | |
469 | 465 | } |
@@ -532,8 +528,7 @@ discard block |
||
532 | 528 | $oRequest = new HTTP_Request(__PROXY_SERVER__); |
533 | 529 | $oRequest->setMethod('POST'); |
534 | 530 | $oRequest->addPostData('arg', serialize(array('Destination' => $url, 'method' => $method, 'body' => $body, 'content_type' => $content_type, "headers" => $headers, "post_data" => $post_data))); |
535 | - } |
|
536 | - else |
|
531 | + } else |
|
537 | 532 | { |
538 | 533 | $oRequest = new HTTP_Request($url); |
539 | 534 | |
@@ -547,8 +542,7 @@ discard block |
||
547 | 542 | { |
548 | 543 | $oRequest->attach($observer); |
549 | 544 | } |
550 | - } |
|
551 | - else |
|
545 | + } else |
|
552 | 546 | { |
553 | 547 | $oRequest->setConfig($key, $val); |
554 | 548 | } |
@@ -576,20 +570,21 @@ discard block |
||
576 | 570 | $oRequest->addPostData($key, $val); |
577 | 571 | } |
578 | 572 | } |
579 | - if(!$content_type) |
|
580 | - $oRequest->addHeader('Content-Type', 'text/html'); |
|
581 | - else |
|
582 | - $oRequest->addHeader('Content-Type', $content_type); |
|
573 | + if(!$content_type) { |
|
574 | + $oRequest->addHeader('Content-Type', 'text/html'); |
|
575 | + } else { |
|
576 | + $oRequest->addHeader('Content-Type', $content_type); |
|
577 | + } |
|
583 | 578 | $oRequest->setMethod($method); |
584 | - if($body) |
|
585 | - $oRequest->setBody($body); |
|
579 | + if($body) { |
|
580 | + $oRequest->setBody($body); |
|
581 | + } |
|
586 | 582 | } |
587 | 583 | |
588 | 584 | if(method_exists($oRequest, 'setConfig')) |
589 | 585 | { |
590 | 586 | $oRequest->setConfig('timeout', $timeout); |
591 | - } |
|
592 | - elseif(property_exists($oRequest, '_timeout')) |
|
587 | + } elseif(property_exists($oRequest, '_timeout')) |
|
593 | 588 | { |
594 | 589 | $oRequest->_timeout = $timeout; |
595 | 590 | } |
@@ -620,13 +615,11 @@ discard block |
||
620 | 615 | if(isset($request_config['store_body']) && !$request_config['store_body']) |
621 | 616 | { |
622 | 617 | return TRUE; |
623 | - } |
|
624 | - else |
|
618 | + } else |
|
625 | 619 | { |
626 | 620 | return $response; |
627 | 621 | } |
628 | - } |
|
629 | - catch(Exception $e) |
|
622 | + } catch(Exception $e) |
|
630 | 623 | { |
631 | 624 | return NULL; |
632 | 625 | } |
@@ -657,8 +650,7 @@ discard block |
||
657 | 650 | try |
658 | 651 | { |
659 | 652 | $result = self::getRemoteResource($url, $body, $timeout, $method, $content_type, $headers, $cookies, $post_data, $request_config); |
660 | - } |
|
661 | - catch(Exception $e) |
|
653 | + } catch(Exception $e) |
|
662 | 654 | { |
663 | 655 | return FALSE; |
664 | 656 | } |
@@ -788,8 +780,7 @@ discard block |
||
788 | 780 | $per = ($width_per > $height_per) ? $height_per : $width_per; |
789 | 781 | $resize_width = $width * $per; |
790 | 782 | $resize_height = $height * $per; |
791 | - } |
|
792 | - else |
|
783 | + } else |
|
793 | 784 | { |
794 | 785 | $per = ($width_per < $height_per) ? $height_per : $width_per; |
795 | 786 | } |
@@ -799,8 +790,7 @@ discard block |
||
799 | 790 | if(function_exists('imagecreateTRUEcolor')) |
800 | 791 | { |
801 | 792 | $thumb = imagecreateTRUEcolor($resize_width, $resize_height); |
802 | - } |
|
803 | - else if(function_exists('imagecreate')) |
|
793 | + } else if(function_exists('imagecreate')) |
|
804 | 794 | { |
805 | 795 | $thumb = imagecreate($resize_width, $resize_height); |
806 | 796 | } |
@@ -865,8 +855,7 @@ discard block |
||
865 | 855 | if(function_exists('imagecopyresampled')) |
866 | 856 | { |
867 | 857 | imagecopyresampled($thumb, $source, $x, $y, 0, 0, $new_width, $new_height, $width, $height); |
868 | - } |
|
869 | - else |
|
858 | + } else |
|
870 | 859 | { |
871 | 860 | imagecopyresized($thumb, $source, $x, $y, 0, 0, $new_width, $new_height, $width, $height); |
872 | 861 | } |
@@ -935,8 +924,7 @@ discard block |
||
935 | 924 | if(is_array($arr) && count($arr) > 0) |
936 | 925 | { |
937 | 926 | return $arr; |
938 | - } |
|
939 | - else |
|
927 | + } else |
|
940 | 928 | { |
941 | 929 | return array(); |
942 | 930 | } |
@@ -986,12 +974,10 @@ discard block |
||
986 | 974 | $return[] = sprintf("%s=\"%s\"", $k, $v); |
987 | 975 | } |
988 | 976 | // value |
989 | - } |
|
990 | - else if(is_object($val)) |
|
977 | + } else if(is_object($val)) |
|
991 | 978 | { |
992 | 979 | continue; |
993 | - } |
|
994 | - else |
|
980 | + } else |
|
995 | 981 | { |
996 | 982 | $return[] = sprintf("%s=\"%s\"", $key, $val); |
997 | 983 | } |