@@ -647,7 +647,7 @@ |
||
647 | 647 | /** |
648 | 648 | * Get length |
649 | 649 | * |
650 | - * @return float Length in bytes |
|
650 | + * @return string|null Length in bytes |
|
651 | 651 | */ |
652 | 652 | public function get_length() |
653 | 653 | { |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | $length = $this->get_length(); |
814 | 814 | if ($length !== null) |
815 | 815 | { |
816 | - return round($length/1048576, 2); |
|
816 | + return round($length / 1048576, 2); |
|
817 | 817 | } |
818 | 818 | else |
819 | 819 | { |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | * @param array|string $options See first paramter to {@see embed} |
918 | 918 | * @return string HTML string to output |
919 | 919 | */ |
920 | - public function native_embed($options='') |
|
920 | + public function native_embed($options = '') |
|
921 | 921 | { |
922 | 922 | return $this->embed($options, true); |
923 | 923 | } |
@@ -991,7 +991,7 @@ discard block |
||
991 | 991 | else |
992 | 992 | { |
993 | 993 | $options = explode(',', $options); |
994 | - foreach($options as $option) |
|
994 | + foreach ($options as $option) |
|
995 | 995 | { |
996 | 996 | $opt = explode(':', $option, 2); |
997 | 997 | if (isset($opt[0], $opt[1])) |
@@ -1058,11 +1058,11 @@ discard block |
||
1058 | 1058 | } |
1059 | 1059 | elseif ($widescreen) |
1060 | 1060 | { |
1061 | - $width = round((intval($height)/9)*16); |
|
1061 | + $width = round((intval($height) / 9) * 16); |
|
1062 | 1062 | } |
1063 | 1063 | else |
1064 | 1064 | { |
1065 | - $width = round((intval($height)/3)*4); |
|
1065 | + $width = round((intval($height) / 3) * 4); |
|
1066 | 1066 | } |
1067 | 1067 | } |
1068 | 1068 | else |
@@ -1092,11 +1092,11 @@ discard block |
||
1092 | 1092 | } |
1093 | 1093 | elseif ($widescreen) |
1094 | 1094 | { |
1095 | - $height = round((intval($width)/16)*9); |
|
1095 | + $height = round((intval($width) / 16) * 9); |
|
1096 | 1096 | } |
1097 | 1097 | else |
1098 | 1098 | { |
1099 | - $height = round((intval($width)/4)*3); |
|
1099 | + $height = round((intval($width) / 4) * 3); |
|
1100 | 1100 | } |
1101 | 1101 | } |
1102 | 1102 | else |
@@ -1126,11 +1126,11 @@ discard block |
||
1126 | 1126 | { |
1127 | 1127 | if ($native) |
1128 | 1128 | { |
1129 | - $embed .= "<embed src=\"" . $this->get_link() . "\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>"; |
|
1129 | + $embed .= "<embed src=\"".$this->get_link()."\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>"; |
|
1130 | 1130 | } |
1131 | 1131 | else |
1132 | 1132 | { |
1133 | - $embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$loop', '$type');</script>"; |
|
1133 | + $embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '".$this->get_link()."', '$loop', '$type');</script>"; |
|
1134 | 1134 | } |
1135 | 1135 | } |
1136 | 1136 | |
@@ -1141,11 +1141,11 @@ discard block |
||
1141 | 1141 | $height += 20; |
1142 | 1142 | if ($native) |
1143 | 1143 | { |
1144 | - $embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>"; |
|
1144 | + $embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=".rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension())."&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>"; |
|
1145 | 1145 | } |
1146 | 1146 | else |
1147 | 1147 | { |
1148 | - $embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "', '$placeholder', '$loop', '$mediaplayer');</script>"; |
|
1148 | + $embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '".rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension())."', '$placeholder', '$loop', '$mediaplayer');</script>"; |
|
1149 | 1149 | } |
1150 | 1150 | } |
1151 | 1151 | |
@@ -1158,16 +1158,16 @@ discard block |
||
1158 | 1158 | { |
1159 | 1159 | if ($placeholder !== '') |
1160 | 1160 | { |
1161 | - $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"" . $this->get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; |
|
1161 | + $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"".$this->get_link()."\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; |
|
1162 | 1162 | } |
1163 | 1163 | else |
1164 | 1164 | { |
1165 | - $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"" . $this->get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; |
|
1165 | + $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"".$this->get_link()."\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; |
|
1166 | 1166 | } |
1167 | 1167 | } |
1168 | 1168 | else |
1169 | 1169 | { |
1170 | - $embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$placeholder', '$loop');</script>"; |
|
1170 | + $embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '".$this->get_link()."', '$placeholder', '$loop');</script>"; |
|
1171 | 1171 | } |
1172 | 1172 | } |
1173 | 1173 | |
@@ -1177,16 +1177,16 @@ discard block |
||
1177 | 1177 | $height += 45; |
1178 | 1178 | if ($native) |
1179 | 1179 | { |
1180 | - $embed .= "<embed type=\"application/x-mplayer2\" src=\"" . $this->get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>"; |
|
1180 | + $embed .= "<embed type=\"application/x-mplayer2\" src=\"".$this->get_link()."\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>"; |
|
1181 | 1181 | } |
1182 | 1182 | else |
1183 | 1183 | { |
1184 | - $embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '" . $this->get_link() . "');</script>"; |
|
1184 | + $embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '".$this->get_link()."');</script>"; |
|
1185 | 1185 | } |
1186 | 1186 | } |
1187 | 1187 | |
1188 | 1188 | // Everything else |
1189 | - else $embed .= '<a href="' . $this->get_link() . '" class="' . $altclass . '">' . $alt . '</a>'; |
|
1189 | + else $embed .= '<a href="'.$this->get_link().'" class="'.$altclass.'">'.$alt.'</a>'; |
|
1190 | 1190 | |
1191 | 1191 | return $embed; |
1192 | 1192 | } |
@@ -1206,7 +1206,7 @@ discard block |
||
1206 | 1206 | { |
1207 | 1207 | // Mime-types by handler. |
1208 | 1208 | $types_flash = array('application/x-shockwave-flash', 'application/futuresplash'); // Flash |
1209 | - $types_fmedia = array('video/flv', 'video/x-flv','flv-application/octet-stream'); // Flash Media Player |
|
1209 | + $types_fmedia = array('video/flv', 'video/x-flv', 'flv-application/octet-stream'); // Flash Media Player |
|
1210 | 1210 | $types_quicktime = array('audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/x-aac', 'audio/aiff', 'audio/x-aiff', 'audio/mid', 'audio/midi', 'audio/x-midi', 'audio/mp4', 'audio/m4a', 'audio/x-m4a', 'audio/wav', 'audio/x-wav', 'video/3gpp', 'video/3gpp2', 'video/m4v', 'video/x-m4v', 'video/mp4', 'video/mpeg', 'video/x-mpeg', 'video/quicktime', 'video/sd-video'); // QuickTime |
1211 | 1211 | $types_wmedia = array('application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx'); // Windows Media |
1212 | 1212 | $types_mp3 = array('audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg'); // MP3 |
@@ -1221,7 +1221,7 @@ discard block |
||
1221 | 1221 | } |
1222 | 1222 | |
1223 | 1223 | // If we encounter an unsupported mime-type, check the file extension and guess intelligently. |
1224 | - if (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3))) |
|
1224 | + if ( ! in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3))) |
|
1225 | 1225 | { |
1226 | 1226 | switch (strtolower($this->get_extension())) |
1227 | 1227 | { |
@@ -282,8 +282,7 @@ discard block |
||
282 | 282 | if ($this->bitrate !== null) |
283 | 283 | { |
284 | 284 | return $this->bitrate; |
285 | - } |
|
286 | - else |
|
285 | + } else |
|
287 | 286 | { |
288 | 287 | return null; |
289 | 288 | } |
@@ -301,8 +300,7 @@ discard block |
||
301 | 300 | if (isset($captions[$key])) |
302 | 301 | { |
303 | 302 | return $captions[$key]; |
304 | - } |
|
305 | - else |
|
303 | + } else |
|
306 | 304 | { |
307 | 305 | return null; |
308 | 306 | } |
@@ -318,8 +316,7 @@ discard block |
||
318 | 316 | if ($this->captions !== null) |
319 | 317 | { |
320 | 318 | return $this->captions; |
321 | - } |
|
322 | - else |
|
319 | + } else |
|
323 | 320 | { |
324 | 321 | return null; |
325 | 322 | } |
@@ -337,8 +334,7 @@ discard block |
||
337 | 334 | if (isset($categories[$key])) |
338 | 335 | { |
339 | 336 | return $categories[$key]; |
340 | - } |
|
341 | - else |
|
337 | + } else |
|
342 | 338 | { |
343 | 339 | return null; |
344 | 340 | } |
@@ -354,8 +350,7 @@ discard block |
||
354 | 350 | if ($this->categories !== null) |
355 | 351 | { |
356 | 352 | return $this->categories; |
357 | - } |
|
358 | - else |
|
353 | + } else |
|
359 | 354 | { |
360 | 355 | return null; |
361 | 356 | } |
@@ -371,8 +366,7 @@ discard block |
||
371 | 366 | if ($this->channels !== null) |
372 | 367 | { |
373 | 368 | return $this->channels; |
374 | - } |
|
375 | - else |
|
369 | + } else |
|
376 | 370 | { |
377 | 371 | return null; |
378 | 372 | } |
@@ -388,8 +382,7 @@ discard block |
||
388 | 382 | if ($this->copyright !== null) |
389 | 383 | { |
390 | 384 | return $this->copyright; |
391 | - } |
|
392 | - else |
|
385 | + } else |
|
393 | 386 | { |
394 | 387 | return null; |
395 | 388 | } |
@@ -407,8 +400,7 @@ discard block |
||
407 | 400 | if (isset($credits[$key])) |
408 | 401 | { |
409 | 402 | return $credits[$key]; |
410 | - } |
|
411 | - else |
|
403 | + } else |
|
412 | 404 | { |
413 | 405 | return null; |
414 | 406 | } |
@@ -424,8 +416,7 @@ discard block |
||
424 | 416 | if ($this->credits !== null) |
425 | 417 | { |
426 | 418 | return $this->credits; |
427 | - } |
|
428 | - else |
|
419 | + } else |
|
429 | 420 | { |
430 | 421 | return null; |
431 | 422 | } |
@@ -441,8 +432,7 @@ discard block |
||
441 | 432 | if ($this->description !== null) |
442 | 433 | { |
443 | 434 | return $this->description; |
444 | - } |
|
445 | - else |
|
435 | + } else |
|
446 | 436 | { |
447 | 437 | return null; |
448 | 438 | } |
@@ -462,13 +452,11 @@ discard block |
||
462 | 452 | { |
463 | 453 | $time = SimplePie_Misc::time_hms($this->duration); |
464 | 454 | return $time; |
465 | - } |
|
466 | - else |
|
455 | + } else |
|
467 | 456 | { |
468 | 457 | return $this->duration; |
469 | 458 | } |
470 | - } |
|
471 | - else |
|
459 | + } else |
|
472 | 460 | { |
473 | 461 | return null; |
474 | 462 | } |
@@ -484,8 +472,7 @@ discard block |
||
484 | 472 | if ($this->expression !== null) |
485 | 473 | { |
486 | 474 | return $this->expression; |
487 | - } |
|
488 | - else |
|
475 | + } else |
|
489 | 476 | { |
490 | 477 | return 'full'; |
491 | 478 | } |
@@ -519,8 +506,7 @@ discard block |
||
519 | 506 | if ($this->framerate !== null) |
520 | 507 | { |
521 | 508 | return $this->framerate; |
522 | - } |
|
523 | - else |
|
509 | + } else |
|
524 | 510 | { |
525 | 511 | return null; |
526 | 512 | } |
@@ -549,8 +535,7 @@ discard block |
||
549 | 535 | if (isset($hashes[$key])) |
550 | 536 | { |
551 | 537 | return $hashes[$key]; |
552 | - } |
|
553 | - else |
|
538 | + } else |
|
554 | 539 | { |
555 | 540 | return null; |
556 | 541 | } |
@@ -566,8 +551,7 @@ discard block |
||
566 | 551 | if ($this->hashes !== null) |
567 | 552 | { |
568 | 553 | return $this->hashes; |
569 | - } |
|
570 | - else |
|
554 | + } else |
|
571 | 555 | { |
572 | 556 | return null; |
573 | 557 | } |
@@ -583,8 +567,7 @@ discard block |
||
583 | 567 | if ($this->height !== null) |
584 | 568 | { |
585 | 569 | return $this->height; |
586 | - } |
|
587 | - else |
|
570 | + } else |
|
588 | 571 | { |
589 | 572 | return null; |
590 | 573 | } |
@@ -601,8 +584,7 @@ discard block |
||
601 | 584 | if ($this->lang !== null) |
602 | 585 | { |
603 | 586 | return $this->lang; |
604 | - } |
|
605 | - else |
|
587 | + } else |
|
606 | 588 | { |
607 | 589 | return null; |
608 | 590 | } |
@@ -620,8 +602,7 @@ discard block |
||
620 | 602 | if (isset($keywords[$key])) |
621 | 603 | { |
622 | 604 | return $keywords[$key]; |
623 | - } |
|
624 | - else |
|
605 | + } else |
|
625 | 606 | { |
626 | 607 | return null; |
627 | 608 | } |
@@ -637,8 +618,7 @@ discard block |
||
637 | 618 | if ($this->keywords !== null) |
638 | 619 | { |
639 | 620 | return $this->keywords; |
640 | - } |
|
641 | - else |
|
621 | + } else |
|
642 | 622 | { |
643 | 623 | return null; |
644 | 624 | } |
@@ -654,8 +634,7 @@ discard block |
||
654 | 634 | if ($this->length !== null) |
655 | 635 | { |
656 | 636 | return $this->length; |
657 | - } |
|
658 | - else |
|
637 | + } else |
|
659 | 638 | { |
660 | 639 | return null; |
661 | 640 | } |
@@ -671,8 +650,7 @@ discard block |
||
671 | 650 | if ($this->link !== null) |
672 | 651 | { |
673 | 652 | return urldecode($this->link); |
674 | - } |
|
675 | - else |
|
653 | + } else |
|
676 | 654 | { |
677 | 655 | return null; |
678 | 656 | } |
@@ -689,8 +667,7 @@ discard block |
||
689 | 667 | if ($this->medium !== null) |
690 | 668 | { |
691 | 669 | return $this->medium; |
692 | - } |
|
693 | - else |
|
670 | + } else |
|
694 | 671 | { |
695 | 672 | return null; |
696 | 673 | } |
@@ -707,8 +684,7 @@ discard block |
||
707 | 684 | if ($this->player !== null) |
708 | 685 | { |
709 | 686 | return $this->player; |
710 | - } |
|
711 | - else |
|
687 | + } else |
|
712 | 688 | { |
713 | 689 | return null; |
714 | 690 | } |
@@ -726,8 +702,7 @@ discard block |
||
726 | 702 | if (isset($ratings[$key])) |
727 | 703 | { |
728 | 704 | return $ratings[$key]; |
729 | - } |
|
730 | - else |
|
705 | + } else |
|
731 | 706 | { |
732 | 707 | return null; |
733 | 708 | } |
@@ -743,8 +718,7 @@ discard block |
||
743 | 718 | if ($this->ratings !== null) |
744 | 719 | { |
745 | 720 | return $this->ratings; |
746 | - } |
|
747 | - else |
|
721 | + } else |
|
748 | 722 | { |
749 | 723 | return null; |
750 | 724 | } |
@@ -762,8 +736,7 @@ discard block |
||
762 | 736 | if (isset($restrictions[$key])) |
763 | 737 | { |
764 | 738 | return $restrictions[$key]; |
765 | - } |
|
766 | - else |
|
739 | + } else |
|
767 | 740 | { |
768 | 741 | return null; |
769 | 742 | } |
@@ -779,8 +752,7 @@ discard block |
||
779 | 752 | if ($this->restrictions !== null) |
780 | 753 | { |
781 | 754 | return $this->restrictions; |
782 | - } |
|
783 | - else |
|
755 | + } else |
|
784 | 756 | { |
785 | 757 | return null; |
786 | 758 | } |
@@ -796,8 +768,7 @@ discard block |
||
796 | 768 | if ($this->samplingrate !== null) |
797 | 769 | { |
798 | 770 | return $this->samplingrate; |
799 | - } |
|
800 | - else |
|
771 | + } else |
|
801 | 772 | { |
802 | 773 | return null; |
803 | 774 | } |
@@ -814,8 +785,7 @@ discard block |
||
814 | 785 | if ($length !== null) |
815 | 786 | { |
816 | 787 | return round($length/1048576, 2); |
817 | - } |
|
818 | - else |
|
788 | + } else |
|
819 | 789 | { |
820 | 790 | return null; |
821 | 791 | } |
@@ -833,8 +803,7 @@ discard block |
||
833 | 803 | if (isset($thumbnails[$key])) |
834 | 804 | { |
835 | 805 | return $thumbnails[$key]; |
836 | - } |
|
837 | - else |
|
806 | + } else |
|
838 | 807 | { |
839 | 808 | return null; |
840 | 809 | } |
@@ -850,8 +819,7 @@ discard block |
||
850 | 819 | if ($this->thumbnails !== null) |
851 | 820 | { |
852 | 821 | return $this->thumbnails; |
853 | - } |
|
854 | - else |
|
822 | + } else |
|
855 | 823 | { |
856 | 824 | return null; |
857 | 825 | } |
@@ -867,8 +835,7 @@ discard block |
||
867 | 835 | if ($this->title !== null) |
868 | 836 | { |
869 | 837 | return $this->title; |
870 | - } |
|
871 | - else |
|
838 | + } else |
|
872 | 839 | { |
873 | 840 | return null; |
874 | 841 | } |
@@ -885,8 +852,7 @@ discard block |
||
885 | 852 | if ($this->type !== null) |
886 | 853 | { |
887 | 854 | return $this->type; |
888 | - } |
|
889 | - else |
|
855 | + } else |
|
890 | 856 | { |
891 | 857 | return null; |
892 | 858 | } |
@@ -902,8 +868,7 @@ discard block |
||
902 | 868 | if ($this->width !== null) |
903 | 869 | { |
904 | 870 | return $this->width; |
905 | - } |
|
906 | - else |
|
871 | + } else |
|
907 | 872 | { |
908 | 873 | return null; |
909 | 874 | } |
@@ -987,8 +952,7 @@ discard block |
||
987 | 952 | if (is_array($options)) |
988 | 953 | { |
989 | 954 | extract($options); |
990 | - } |
|
991 | - else |
|
955 | + } else |
|
992 | 956 | { |
993 | 957 | $options = explode(',', $options); |
994 | 958 | foreach($options as $option) |
@@ -1055,17 +1019,14 @@ discard block |
||
1055 | 1019 | if ($height === 'auto') |
1056 | 1020 | { |
1057 | 1021 | $width = 480; |
1058 | - } |
|
1059 | - elseif ($widescreen) |
|
1022 | + } elseif ($widescreen) |
|
1060 | 1023 | { |
1061 | 1024 | $width = round((intval($height)/9)*16); |
1062 | - } |
|
1063 | - else |
|
1025 | + } else |
|
1064 | 1026 | { |
1065 | 1027 | $width = round((intval($height)/3)*4); |
1066 | 1028 | } |
1067 | - } |
|
1068 | - else |
|
1029 | + } else |
|
1069 | 1030 | { |
1070 | 1031 | $width = '100%'; |
1071 | 1032 | } |
@@ -1076,35 +1037,29 @@ discard block |
||
1076 | 1037 | if ($mime === 'audio') |
1077 | 1038 | { |
1078 | 1039 | $height = 0; |
1079 | - } |
|
1080 | - elseif ($mime === 'video') |
|
1040 | + } elseif ($mime === 'video') |
|
1081 | 1041 | { |
1082 | 1042 | if ($width === 'auto') |
1083 | 1043 | { |
1084 | 1044 | if ($widescreen) |
1085 | 1045 | { |
1086 | 1046 | $height = 270; |
1087 | - } |
|
1088 | - else |
|
1047 | + } else |
|
1089 | 1048 | { |
1090 | 1049 | $height = 360; |
1091 | 1050 | } |
1092 | - } |
|
1093 | - elseif ($widescreen) |
|
1051 | + } elseif ($widescreen) |
|
1094 | 1052 | { |
1095 | 1053 | $height = round((intval($width)/16)*9); |
1096 | - } |
|
1097 | - else |
|
1054 | + } else |
|
1098 | 1055 | { |
1099 | 1056 | $height = round((intval($width)/4)*3); |
1100 | 1057 | } |
1101 | - } |
|
1102 | - else |
|
1058 | + } else |
|
1103 | 1059 | { |
1104 | 1060 | $height = 376; |
1105 | 1061 | } |
1106 | - } |
|
1107 | - elseif ($mime === 'audio') |
|
1062 | + } elseif ($mime === 'audio') |
|
1108 | 1063 | { |
1109 | 1064 | $height = 0; |
1110 | 1065 | } |
@@ -1113,8 +1068,7 @@ discard block |
||
1113 | 1068 | if ($mime === 'audio') |
1114 | 1069 | { |
1115 | 1070 | $placeholder = $audio; |
1116 | - } |
|
1117 | - elseif ($mime === 'video') |
|
1071 | + } elseif ($mime === 'video') |
|
1118 | 1072 | { |
1119 | 1073 | $placeholder = $video; |
1120 | 1074 | } |
@@ -1127,8 +1081,7 @@ discard block |
||
1127 | 1081 | if ($native) |
1128 | 1082 | { |
1129 | 1083 | $embed .= "<embed src=\"" . $this->get_link() . "\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>"; |
1130 | - } |
|
1131 | - else |
|
1084 | + } else |
|
1132 | 1085 | { |
1133 | 1086 | $embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$loop', '$type');</script>"; |
1134 | 1087 | } |
@@ -1142,8 +1095,7 @@ discard block |
||
1142 | 1095 | if ($native) |
1143 | 1096 | { |
1144 | 1097 | $embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>"; |
1145 | - } |
|
1146 | - else |
|
1098 | + } else |
|
1147 | 1099 | { |
1148 | 1100 | $embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "', '$placeholder', '$loop', '$mediaplayer');</script>"; |
1149 | 1101 | } |
@@ -1159,13 +1111,11 @@ discard block |
||
1159 | 1111 | if ($placeholder !== '') |
1160 | 1112 | { |
1161 | 1113 | $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"" . $this->get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; |
1162 | - } |
|
1163 | - else |
|
1114 | + } else |
|
1164 | 1115 | { |
1165 | 1116 | $embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"" . $this->get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>"; |
1166 | 1117 | } |
1167 | - } |
|
1168 | - else |
|
1118 | + } else |
|
1169 | 1119 | { |
1170 | 1120 | $embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$placeholder', '$loop');</script>"; |
1171 | 1121 | } |
@@ -1178,15 +1128,16 @@ discard block |
||
1178 | 1128 | if ($native) |
1179 | 1129 | { |
1180 | 1130 | $embed .= "<embed type=\"application/x-mplayer2\" src=\"" . $this->get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>"; |
1181 | - } |
|
1182 | - else |
|
1131 | + } else |
|
1183 | 1132 | { |
1184 | 1133 | $embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '" . $this->get_link() . "');</script>"; |
1185 | 1134 | } |
1186 | 1135 | } |
1187 | 1136 | |
1188 | 1137 | // Everything else |
1189 | - else $embed .= '<a href="' . $this->get_link() . '" class="' . $altclass . '">' . $alt . '</a>'; |
|
1138 | + else { |
|
1139 | + $embed .= '<a href="' . $this->get_link() . '" class="' . $altclass . '">' . $alt . '</a>'; |
|
1140 | + } |
|
1190 | 1141 | |
1191 | 1142 | return $embed; |
1192 | 1143 | } |
@@ -1214,8 +1165,7 @@ discard block |
||
1214 | 1165 | if ($this->get_type() !== null) |
1215 | 1166 | { |
1216 | 1167 | $type = strtolower($this->type); |
1217 | - } |
|
1218 | - else |
|
1168 | + } else |
|
1219 | 1169 | { |
1220 | 1170 | $type = null; |
1221 | 1171 | } |
@@ -1349,29 +1299,23 @@ discard block |
||
1349 | 1299 | if (in_array($type, $types_flash)) |
1350 | 1300 | { |
1351 | 1301 | return 'flash'; |
1352 | - } |
|
1353 | - elseif (in_array($type, $types_fmedia)) |
|
1302 | + } elseif (in_array($type, $types_fmedia)) |
|
1354 | 1303 | { |
1355 | 1304 | return 'fmedia'; |
1356 | - } |
|
1357 | - elseif (in_array($type, $types_quicktime)) |
|
1305 | + } elseif (in_array($type, $types_quicktime)) |
|
1358 | 1306 | { |
1359 | 1307 | return 'quicktime'; |
1360 | - } |
|
1361 | - elseif (in_array($type, $types_wmedia)) |
|
1308 | + } elseif (in_array($type, $types_wmedia)) |
|
1362 | 1309 | { |
1363 | 1310 | return 'wmedia'; |
1364 | - } |
|
1365 | - elseif (in_array($type, $types_mp3)) |
|
1311 | + } elseif (in_array($type, $types_mp3)) |
|
1366 | 1312 | { |
1367 | 1313 | return 'mp3'; |
1368 | - } |
|
1369 | - else |
|
1314 | + } else |
|
1370 | 1315 | { |
1371 | 1316 | return null; |
1372 | 1317 | } |
1373 | - } |
|
1374 | - else |
|
1318 | + } else |
|
1375 | 1319 | { |
1376 | 1320 | return $type; |
1377 | 1321 | } |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | * |
265 | 265 | * Returns false if $base is not absolute, otherwise an IRI. |
266 | 266 | * |
267 | - * @param IRI|string $base (Absolute) Base IRI |
|
267 | + * @param SimplePie_IRI $base (Absolute) Base IRI |
|
268 | 268 | * @param IRI|string $relative Relative IRI |
269 | 269 | * @return IRI|false |
270 | 270 | */ |
@@ -1119,6 +1119,7 @@ discard block |
||
1119 | 1119 | /** |
1120 | 1120 | * Convert an IRI to a URI (or parts thereof) |
1121 | 1121 | * |
1122 | + * @param false|string $string |
|
1122 | 1123 | * @return string |
1123 | 1124 | */ |
1124 | 1125 | public function to_uri($string) |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function __set($name, $value) |
150 | 150 | { |
151 | - if (method_exists($this, 'set_' . $name)) |
|
151 | + if (method_exists($this, 'set_'.$name)) |
|
152 | 152 | { |
153 | - call_user_func(array($this, 'set_' . $name), $value); |
|
153 | + call_user_func(array($this, 'set_'.$name), $value); |
|
154 | 154 | } |
155 | 155 | elseif ( |
156 | 156 | $name === 'iauthority' |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | || $name === 'ifragment' |
162 | 162 | ) |
163 | 163 | { |
164 | - call_user_func(array($this, 'set_' . substr($name, 1)), $value); |
|
164 | + call_user_func(array($this, 'set_'.substr($name, 1)), $value); |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $return = $this->$name; |
192 | 192 | } |
193 | 193 | // host -> ihost |
194 | - elseif (($prop = 'i' . $name) && array_key_exists($prop, $props)) |
|
194 | + elseif (($prop = 'i'.$name) && array_key_exists($prop, $props)) |
|
195 | 195 | { |
196 | 196 | $name = $prop; |
197 | 197 | $return = $this->$prop; |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | } |
205 | 205 | else |
206 | 206 | { |
207 | - trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE); |
|
207 | + trigger_error('Undefined property: '.get_class($this).'::'.$name, E_USER_NOTICE); |
|
208 | 208 | $return = null; |
209 | 209 | } |
210 | 210 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | public function __isset($name) |
228 | 228 | { |
229 | - if (method_exists($this, 'get_' . $name) || isset($this->$name)) |
|
229 | + if (method_exists($this, 'get_'.$name) || isset($this->$name)) |
|
230 | 230 | { |
231 | 231 | return true; |
232 | 232 | } |
@@ -243,9 +243,9 @@ discard block |
||
243 | 243 | */ |
244 | 244 | public function __unset($name) |
245 | 245 | { |
246 | - if (method_exists($this, 'set_' . $name)) |
|
246 | + if (method_exists($this, 'set_'.$name)) |
|
247 | 247 | { |
248 | - call_user_func(array($this, 'set_' . $name), ''); |
|
248 | + call_user_func(array($this, 'set_'.$name), ''); |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 | |
@@ -270,11 +270,11 @@ discard block |
||
270 | 270 | */ |
271 | 271 | public static function absolutize($base, $relative) |
272 | 272 | { |
273 | - if (!($relative instanceof SimplePie_IRI)) |
|
273 | + if ( ! ($relative instanceof SimplePie_IRI)) |
|
274 | 274 | { |
275 | 275 | $relative = new SimplePie_IRI($relative); |
276 | 276 | } |
277 | - if (!$relative->is_valid()) |
|
277 | + if ( ! $relative->is_valid()) |
|
278 | 278 | { |
279 | 279 | return false; |
280 | 280 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | } |
285 | 285 | else |
286 | 286 | { |
287 | - if (!($base instanceof SimplePie_IRI)) |
|
287 | + if ( ! ($base instanceof SimplePie_IRI)) |
|
288 | 288 | { |
289 | 289 | $base = new SimplePie_IRI($base); |
290 | 290 | } |
@@ -312,11 +312,11 @@ discard block |
||
312 | 312 | } |
313 | 313 | elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '') |
314 | 314 | { |
315 | - $target->ipath = '/' . $relative->ipath; |
|
315 | + $target->ipath = '/'.$relative->ipath; |
|
316 | 316 | } |
317 | 317 | elseif (($last_segment = strrpos($base->ipath, '/')) !== false) |
318 | 318 | { |
319 | - $target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath; |
|
319 | + $target->ipath = substr($base->ipath, 0, $last_segment + 1).$relative->ipath; |
|
320 | 320 | } |
321 | 321 | else |
322 | 322 | { |
@@ -370,19 +370,19 @@ discard block |
||
370 | 370 | { |
371 | 371 | $match['scheme'] = null; |
372 | 372 | } |
373 | - if (!isset($match[3]) || $match[3] === '') |
|
373 | + if ( ! isset($match[3]) || $match[3] === '') |
|
374 | 374 | { |
375 | 375 | $match['authority'] = null; |
376 | 376 | } |
377 | - if (!isset($match[5])) |
|
377 | + if ( ! isset($match[5])) |
|
378 | 378 | { |
379 | 379 | $match['path'] = ''; |
380 | 380 | } |
381 | - if (!isset($match[6]) || $match[6] === '') |
|
381 | + if ( ! isset($match[6]) || $match[6] === '') |
|
382 | 382 | { |
383 | 383 | $match['query'] = null; |
384 | 384 | } |
385 | - if (!isset($match[8]) || $match[8] === '') |
|
385 | + if ( ! isset($match[8]) || $match[8] === '') |
|
386 | 386 | { |
387 | 387 | $match['fragment'] = null; |
388 | 388 | } |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | $input = ''; |
453 | 453 | } |
454 | 454 | } |
455 | - return $output . $input; |
|
455 | + return $output.$input; |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | /** |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | // Percent encode anything invalid or not in ucschar |
552 | 552 | if ( |
553 | 553 | // Invalid sequences |
554 | - !$valid |
|
554 | + ! $valid |
|
555 | 555 | // Non-shortest form sequences are invalid |
556 | 556 | || $length > 1 && $character <= 0x7F |
557 | 557 | || $length > 2 && $character <= 0x7FF |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | ) |
569 | 569 | && ( |
570 | 570 | // Everything not in iprivate, if it applies |
571 | - !$iprivate |
|
571 | + ! $iprivate |
|
572 | 572 | || $character < 0xE000 |
573 | 573 | || $character > 0x10FFFD |
574 | 574 | ) |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | $value = hexdec($bytes[$i]); |
619 | 619 | |
620 | 620 | // If we're the first byte of sequence: |
621 | - if (!$remaining) |
|
621 | + if ( ! $remaining) |
|
622 | 622 | { |
623 | 623 | // Start position |
624 | 624 | $start = $i; |
@@ -679,12 +679,12 @@ discard block |
||
679 | 679 | } |
680 | 680 | |
681 | 681 | // If we've reached the end of the current byte sequence, append it to Unicode::$data |
682 | - if (!$remaining) |
|
682 | + if ( ! $remaining) |
|
683 | 683 | { |
684 | 684 | // Percent encode anything invalid or not in iunreserved |
685 | 685 | if ( |
686 | 686 | // Invalid sequences |
687 | - !$valid |
|
687 | + ! $valid |
|
688 | 688 | // Non-shortest form sequences are invalid |
689 | 689 | || $length > 1 && $character <= 0x7F |
690 | 690 | || $length > 2 && $character <= 0x7FF |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | { |
707 | 707 | for ($j = $start; $j <= $i; $j++) |
708 | 708 | { |
709 | - $string .= '%' . strtoupper($bytes[$j]); |
|
709 | + $string .= '%'.strtoupper($bytes[$j]); |
|
710 | 710 | } |
711 | 711 | } |
712 | 712 | else |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | { |
726 | 726 | for ($j = $start; $j < $len; $j++) |
727 | 727 | { |
728 | - $string .= '%' . strtoupper($bytes[$j]); |
|
728 | + $string .= '%'.strtoupper($bytes[$j]); |
|
729 | 729 | } |
730 | 730 | } |
731 | 731 | |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | ) || |
778 | 778 | ( |
779 | 779 | $this->scheme === null && |
780 | - !$isauthority && |
|
780 | + ! $isauthority && |
|
781 | 781 | strpos($this->ipath, ':') !== false && |
782 | 782 | (strpos($this->ipath, '/') === false ? true : strpos($this->ipath, ':') < strpos($this->ipath, '/')) |
783 | 783 | ) |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | public function set_iri($iri) |
801 | 801 | { |
802 | 802 | static $cache; |
803 | - if (!$cache) |
|
803 | + if ( ! $cache) |
|
804 | 804 | { |
805 | 805 | $cache = array(); |
806 | 806 | } |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | else |
825 | 825 | { |
826 | 826 | $parsed = $this->parse_iri((string) $iri); |
827 | - if (!$parsed) |
|
827 | + if ( ! $parsed) |
|
828 | 828 | { |
829 | 829 | return false; |
830 | 830 | } |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | { |
861 | 861 | $this->scheme = null; |
862 | 862 | } |
863 | - elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme)) |
|
863 | + elseif ( ! preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme)) |
|
864 | 864 | { |
865 | 865 | $this->scheme = null; |
866 | 866 | return false; |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | public function set_authority($authority) |
883 | 883 | { |
884 | 884 | static $cache; |
885 | - if (!$cache) |
|
885 | + if ( ! $cache) |
|
886 | 886 | $cache = array(); |
887 | 887 | |
888 | 888 | if ($authority === null) |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | { |
979 | 979 | if (SimplePie_Net_IPv6::check_ipv6(substr($ihost, 1, -1))) |
980 | 980 | { |
981 | - $this->ihost = '[' . SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)) . ']'; |
|
981 | + $this->ihost = '['.SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)).']'; |
|
982 | 982 | } |
983 | 983 | else |
984 | 984 | { |
@@ -1052,7 +1052,7 @@ discard block |
||
1052 | 1052 | public function set_path($ipath) |
1053 | 1053 | { |
1054 | 1054 | static $cache; |
1055 | - if (!$cache) |
|
1055 | + if ( ! $cache) |
|
1056 | 1056 | { |
1057 | 1057 | $cache = array(); |
1058 | 1058 | } |
@@ -1069,7 +1069,7 @@ discard block |
||
1069 | 1069 | $removed = $this->remove_dot_segments($valid); |
1070 | 1070 | |
1071 | 1071 | $cache[$ipath] = array($valid, $removed); |
1072 | - $this->ipath = ($this->scheme !== null) ? $removed : $valid; |
|
1072 | + $this->ipath = ($this->scheme !== null) ? $removed : $valid; |
|
1073 | 1073 | } |
1074 | 1074 | |
1075 | 1075 | $this->scheme_normalization(); |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | public function to_uri($string) |
1125 | 1125 | { |
1126 | 1126 | static $non_ascii; |
1127 | - if (!$non_ascii) |
|
1127 | + if ( ! $non_ascii) |
|
1128 | 1128 | { |
1129 | 1129 | $non_ascii = implode('', range("\x80", "\xFF")); |
1130 | 1130 | } |
@@ -1148,7 +1148,7 @@ discard block |
||
1148 | 1148 | */ |
1149 | 1149 | public function get_iri() |
1150 | 1150 | { |
1151 | - if (!$this->is_valid()) |
|
1151 | + if ( ! $this->is_valid()) |
|
1152 | 1152 | { |
1153 | 1153 | return false; |
1154 | 1154 | } |
@@ -1156,27 +1156,27 @@ discard block |
||
1156 | 1156 | $iri = ''; |
1157 | 1157 | if ($this->scheme !== null) |
1158 | 1158 | { |
1159 | - $iri .= $this->scheme . ':'; |
|
1159 | + $iri .= $this->scheme.':'; |
|
1160 | 1160 | } |
1161 | 1161 | if (($iauthority = $this->get_iauthority()) !== null) |
1162 | 1162 | { |
1163 | - $iri .= '//' . $iauthority; |
|
1163 | + $iri .= '//'.$iauthority; |
|
1164 | 1164 | } |
1165 | 1165 | if ($this->ipath !== '') |
1166 | 1166 | { |
1167 | 1167 | $iri .= $this->ipath; |
1168 | 1168 | } |
1169 | - elseif (!empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '') |
|
1169 | + elseif ( ! empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '') |
|
1170 | 1170 | { |
1171 | 1171 | $iri .= $this->normalization[$this->scheme]['ipath']; |
1172 | 1172 | } |
1173 | 1173 | if ($this->iquery !== null) |
1174 | 1174 | { |
1175 | - $iri .= '?' . $this->iquery; |
|
1175 | + $iri .= '?'.$this->iquery; |
|
1176 | 1176 | } |
1177 | 1177 | if ($this->ifragment !== null) |
1178 | 1178 | { |
1179 | - $iri .= '#' . $this->ifragment; |
|
1179 | + $iri .= '#'.$this->ifragment; |
|
1180 | 1180 | } |
1181 | 1181 | |
1182 | 1182 | return $iri; |
@@ -1204,7 +1204,7 @@ discard block |
||
1204 | 1204 | $iauthority = ''; |
1205 | 1205 | if ($this->iuserinfo !== null) |
1206 | 1206 | { |
1207 | - $iauthority .= $this->iuserinfo . '@'; |
|
1207 | + $iauthority .= $this->iuserinfo.'@'; |
|
1208 | 1208 | } |
1209 | 1209 | if ($this->ihost !== null) |
1210 | 1210 | { |
@@ -1212,7 +1212,7 @@ discard block |
||
1212 | 1212 | } |
1213 | 1213 | if ($this->port !== null) |
1214 | 1214 | { |
1215 | - $iauthority .= ':' . $this->port; |
|
1215 | + $iauthority .= ':'.$this->port; |
|
1216 | 1216 | } |
1217 | 1217 | return $iauthority; |
1218 | 1218 | } |
@@ -151,8 +151,7 @@ discard block |
||
151 | 151 | if (method_exists($this, 'set_' . $name)) |
152 | 152 | { |
153 | 153 | call_user_func(array($this, 'set_' . $name), $value); |
154 | - } |
|
155 | - elseif ( |
|
154 | + } elseif ( |
|
156 | 155 | $name === 'iauthority' |
157 | 156 | || $name === 'iuserinfo' |
158 | 157 | || $name === 'ihost' |
@@ -185,8 +184,7 @@ discard block |
||
185 | 184 | ) |
186 | 185 | { |
187 | 186 | $return = $this->{"get_$name"}(); |
188 | - } |
|
189 | - elseif (array_key_exists($name, $props)) |
|
187 | + } elseif (array_key_exists($name, $props)) |
|
190 | 188 | { |
191 | 189 | $return = $this->$name; |
192 | 190 | } |
@@ -201,8 +199,7 @@ discard block |
||
201 | 199 | { |
202 | 200 | $name = $prop; |
203 | 201 | $return = $this->$prop; |
204 | - } |
|
205 | - else |
|
202 | + } else |
|
206 | 203 | { |
207 | 204 | trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE); |
208 | 205 | $return = null; |
@@ -211,8 +208,7 @@ discard block |
||
211 | 208 | if ($return === null && isset($this->normalization[$this->scheme][$name])) |
212 | 209 | { |
213 | 210 | return $this->normalization[$this->scheme][$name]; |
214 | - } |
|
215 | - else |
|
211 | + } else |
|
216 | 212 | { |
217 | 213 | return $return; |
218 | 214 | } |
@@ -229,8 +225,7 @@ discard block |
||
229 | 225 | if (method_exists($this, 'get_' . $name) || isset($this->$name)) |
230 | 226 | { |
231 | 227 | return true; |
232 | - } |
|
233 | - else |
|
228 | + } else |
|
234 | 229 | { |
235 | 230 | return false; |
236 | 231 | } |
@@ -277,12 +272,10 @@ discard block |
||
277 | 272 | if (!$relative->is_valid()) |
278 | 273 | { |
279 | 274 | return false; |
280 | - } |
|
281 | - elseif ($relative->scheme !== null) |
|
275 | + } elseif ($relative->scheme !== null) |
|
282 | 276 | { |
283 | 277 | return clone $relative; |
284 | - } |
|
285 | - else |
|
278 | + } else |
|
286 | 279 | { |
287 | 280 | if (!($base instanceof SimplePie_IRI)) |
288 | 281 | { |
@@ -296,8 +289,7 @@ discard block |
||
296 | 289 | { |
297 | 290 | $target = clone $relative; |
298 | 291 | $target->scheme = $base->scheme; |
299 | - } |
|
300 | - else |
|
292 | + } else |
|
301 | 293 | { |
302 | 294 | $target = new SimplePie_IRI; |
303 | 295 | $target->scheme = $base->scheme; |
@@ -309,46 +301,39 @@ discard block |
||
309 | 301 | if ($relative->ipath[0] === '/') |
310 | 302 | { |
311 | 303 | $target->ipath = $relative->ipath; |
312 | - } |
|
313 | - elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '') |
|
304 | + } elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '') |
|
314 | 305 | { |
315 | 306 | $target->ipath = '/' . $relative->ipath; |
316 | - } |
|
317 | - elseif (($last_segment = strrpos($base->ipath, '/')) !== false) |
|
307 | + } elseif (($last_segment = strrpos($base->ipath, '/')) !== false) |
|
318 | 308 | { |
319 | 309 | $target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath; |
320 | - } |
|
321 | - else |
|
310 | + } else |
|
322 | 311 | { |
323 | 312 | $target->ipath = $relative->ipath; |
324 | 313 | } |
325 | 314 | $target->ipath = $target->remove_dot_segments($target->ipath); |
326 | 315 | $target->iquery = $relative->iquery; |
327 | - } |
|
328 | - else |
|
316 | + } else |
|
329 | 317 | { |
330 | 318 | $target->ipath = $base->ipath; |
331 | 319 | if ($relative->iquery !== null) |
332 | 320 | { |
333 | 321 | $target->iquery = $relative->iquery; |
334 | - } |
|
335 | - elseif ($base->iquery !== null) |
|
322 | + } elseif ($base->iquery !== null) |
|
336 | 323 | { |
337 | 324 | $target->iquery = $base->iquery; |
338 | 325 | } |
339 | 326 | } |
340 | 327 | $target->ifragment = $relative->ifragment; |
341 | 328 | } |
342 | - } |
|
343 | - else |
|
329 | + } else |
|
344 | 330 | { |
345 | 331 | $target = clone $base; |
346 | 332 | $target->ifragment = null; |
347 | 333 | } |
348 | 334 | $target->scheme_normalization(); |
349 | 335 | return $target; |
350 | - } |
|
351 | - else |
|
336 | + } else |
|
352 | 337 | { |
353 | 338 | return false; |
354 | 339 | } |
@@ -387,8 +372,7 @@ discard block |
||
387 | 372 | $match['fragment'] = null; |
388 | 373 | } |
389 | 374 | return $match; |
390 | - } |
|
391 | - else |
|
375 | + } else |
|
392 | 376 | { |
393 | 377 | // This can occur when a paragraph is accidentally parsed as a URI |
394 | 378 | return false; |
@@ -410,8 +394,7 @@ discard block |
||
410 | 394 | if (strpos($input, '../') === 0) |
411 | 395 | { |
412 | 396 | $input = substr($input, 3); |
413 | - } |
|
414 | - elseif (strpos($input, './') === 0) |
|
397 | + } elseif (strpos($input, './') === 0) |
|
415 | 398 | { |
416 | 399 | $input = substr($input, 2); |
417 | 400 | } |
@@ -419,8 +402,7 @@ discard block |
||
419 | 402 | elseif (strpos($input, '/./') === 0) |
420 | 403 | { |
421 | 404 | $input = substr($input, 2); |
422 | - } |
|
423 | - elseif ($input === '/.') |
|
405 | + } elseif ($input === '/.') |
|
424 | 406 | { |
425 | 407 | $input = '/'; |
426 | 408 | } |
@@ -429,8 +411,7 @@ discard block |
||
429 | 411 | { |
430 | 412 | $input = substr($input, 3); |
431 | 413 | $output = substr_replace($output, '', strrpos($output, '/')); |
432 | - } |
|
433 | - elseif ($input === '/..') |
|
414 | + } elseif ($input === '/..') |
|
434 | 415 | { |
435 | 416 | $input = '/'; |
436 | 417 | $output = substr_replace($output, '', strrpos($output, '/')); |
@@ -445,8 +426,7 @@ discard block |
||
445 | 426 | { |
446 | 427 | $output .= substr($input, 0, $pos); |
447 | 428 | $input = substr_replace($input, '', 0, $pos); |
448 | - } |
|
449 | - else |
|
429 | + } else |
|
450 | 430 | { |
451 | 431 | $output .= $input; |
452 | 432 | $input = ''; |
@@ -540,8 +520,7 @@ discard block |
||
540 | 520 | break; |
541 | 521 | } |
542 | 522 | } |
543 | - } |
|
544 | - else |
|
523 | + } else |
|
545 | 524 | { |
546 | 525 | $position = $strlen - 1; |
547 | 526 | $valid = false; |
@@ -575,8 +554,9 @@ discard block |
||
575 | 554 | ) |
576 | 555 | { |
577 | 556 | // If we were a character, pretend we weren't, but rather an error. |
578 | - if ($valid) |
|
579 | - $position--; |
|
557 | + if ($valid) { |
|
558 | + $position--; |
|
559 | + } |
|
580 | 560 | |
581 | 561 | for ($j = $start; $j <= $position; $j++) |
582 | 562 | { |
@@ -708,8 +688,7 @@ discard block |
||
708 | 688 | { |
709 | 689 | $string .= '%' . strtoupper($bytes[$j]); |
710 | 690 | } |
711 | - } |
|
712 | - else |
|
691 | + } else |
|
713 | 692 | { |
714 | 693 | for ($j = $start; $j <= $i; $j++) |
715 | 694 | { |
@@ -808,8 +787,7 @@ discard block |
||
808 | 787 | if ($iri === null) |
809 | 788 | { |
810 | 789 | return true; |
811 | - } |
|
812 | - elseif (isset($cache[$iri])) |
|
790 | + } elseif (isset($cache[$iri])) |
|
813 | 791 | { |
814 | 792 | list($this->scheme, |
815 | 793 | $this->iuserinfo, |
@@ -820,8 +798,7 @@ discard block |
||
820 | 798 | $this->ifragment, |
821 | 799 | $return) = $cache[$iri]; |
822 | 800 | return $return; |
823 | - } |
|
824 | - else |
|
801 | + } else |
|
825 | 802 | { |
826 | 803 | $parsed = $this->parse_iri((string) $iri); |
827 | 804 | if (!$parsed) |
@@ -859,13 +836,11 @@ discard block |
||
859 | 836 | if ($scheme === null) |
860 | 837 | { |
861 | 838 | $this->scheme = null; |
862 | - } |
|
863 | - elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme)) |
|
839 | + } elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme)) |
|
864 | 840 | { |
865 | 841 | $this->scheme = null; |
866 | 842 | return false; |
867 | - } |
|
868 | - else |
|
843 | + } else |
|
869 | 844 | { |
870 | 845 | $this->scheme = strtolower($scheme); |
871 | 846 | } |
@@ -882,8 +857,9 @@ discard block |
||
882 | 857 | public function set_authority($authority) |
883 | 858 | { |
884 | 859 | static $cache; |
885 | - if (!$cache) |
|
886 | - $cache = array(); |
|
860 | + if (!$cache) { |
|
861 | + $cache = array(); |
|
862 | + } |
|
887 | 863 | |
888 | 864 | if ($authority === null) |
889 | 865 | { |
@@ -891,8 +867,7 @@ discard block |
||
891 | 867 | $this->ihost = null; |
892 | 868 | $this->port = null; |
893 | 869 | return true; |
894 | - } |
|
895 | - elseif (isset($cache[$authority])) |
|
870 | + } elseif (isset($cache[$authority])) |
|
896 | 871 | { |
897 | 872 | list($this->iuserinfo, |
898 | 873 | $this->ihost, |
@@ -900,16 +875,14 @@ discard block |
||
900 | 875 | $return) = $cache[$authority]; |
901 | 876 | |
902 | 877 | return $return; |
903 | - } |
|
904 | - else |
|
878 | + } else |
|
905 | 879 | { |
906 | 880 | $remaining = $authority; |
907 | 881 | if (($iuserinfo_end = strrpos($remaining, '@')) !== false) |
908 | 882 | { |
909 | 883 | $iuserinfo = substr($remaining, 0, $iuserinfo_end); |
910 | 884 | $remaining = substr($remaining, $iuserinfo_end + 1); |
911 | - } |
|
912 | - else |
|
885 | + } else |
|
913 | 886 | { |
914 | 887 | $iuserinfo = null; |
915 | 888 | } |
@@ -920,8 +893,7 @@ discard block |
||
920 | 893 | $port = null; |
921 | 894 | } |
922 | 895 | $remaining = substr($remaining, 0, $port_start); |
923 | - } |
|
924 | - else |
|
896 | + } else |
|
925 | 897 | { |
926 | 898 | $port = null; |
927 | 899 | } |
@@ -950,8 +922,7 @@ discard block |
||
950 | 922 | if ($iuserinfo === null) |
951 | 923 | { |
952 | 924 | $this->iuserinfo = null; |
953 | - } |
|
954 | - else |
|
925 | + } else |
|
955 | 926 | { |
956 | 927 | $this->iuserinfo = $this->replace_invalid_with_pct_encoding($iuserinfo, '!$&\'()*+,;=:'); |
957 | 928 | $this->scheme_normalization(); |
@@ -973,20 +944,17 @@ discard block |
||
973 | 944 | { |
974 | 945 | $this->ihost = null; |
975 | 946 | return true; |
976 | - } |
|
977 | - elseif (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']') |
|
947 | + } elseif (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']') |
|
978 | 948 | { |
979 | 949 | if (SimplePie_Net_IPv6::check_ipv6(substr($ihost, 1, -1))) |
980 | 950 | { |
981 | 951 | $this->ihost = '[' . SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)) . ']'; |
982 | - } |
|
983 | - else |
|
952 | + } else |
|
984 | 953 | { |
985 | 954 | $this->ihost = null; |
986 | 955 | return false; |
987 | 956 | } |
988 | - } |
|
989 | - else |
|
957 | + } else |
|
990 | 958 | { |
991 | 959 | $ihost = $this->replace_invalid_with_pct_encoding($ihost, '!$&\'()*+,;='); |
992 | 960 | |
@@ -1000,8 +968,7 @@ discard block |
||
1000 | 968 | if ($ihost[$position] === '%') |
1001 | 969 | { |
1002 | 970 | $position += 3; |
1003 | - } |
|
1004 | - else |
|
971 | + } else |
|
1005 | 972 | { |
1006 | 973 | $ihost[$position] = strtolower($ihost[$position]); |
1007 | 974 | $position++; |
@@ -1029,14 +996,12 @@ discard block |
||
1029 | 996 | { |
1030 | 997 | $this->port = null; |
1031 | 998 | return true; |
1032 | - } |
|
1033 | - elseif (strspn($port, '0123456789') === strlen($port)) |
|
999 | + } elseif (strspn($port, '0123456789') === strlen($port)) |
|
1034 | 1000 | { |
1035 | 1001 | $this->port = (int) $port; |
1036 | 1002 | $this->scheme_normalization(); |
1037 | 1003 | return true; |
1038 | - } |
|
1039 | - else |
|
1004 | + } else |
|
1040 | 1005 | { |
1041 | 1006 | $this->port = null; |
1042 | 1007 | return false; |
@@ -1062,8 +1027,7 @@ discard block |
||
1062 | 1027 | if (isset($cache[$ipath])) |
1063 | 1028 | { |
1064 | 1029 | $this->ipath = $cache[$ipath][(int) ($this->scheme !== null)]; |
1065 | - } |
|
1066 | - else |
|
1030 | + } else |
|
1067 | 1031 | { |
1068 | 1032 | $valid = $this->replace_invalid_with_pct_encoding($ipath, '!$&\'()*+,;=@:/'); |
1069 | 1033 | $removed = $this->remove_dot_segments($valid); |
@@ -1087,8 +1051,7 @@ discard block |
||
1087 | 1051 | if ($iquery === null) |
1088 | 1052 | { |
1089 | 1053 | $this->iquery = null; |
1090 | - } |
|
1091 | - else |
|
1054 | + } else |
|
1092 | 1055 | { |
1093 | 1056 | $this->iquery = $this->replace_invalid_with_pct_encoding($iquery, '!$&\'()*+,;=:@/?', true); |
1094 | 1057 | $this->scheme_normalization(); |
@@ -1107,8 +1070,7 @@ discard block |
||
1107 | 1070 | if ($ifragment === null) |
1108 | 1071 | { |
1109 | 1072 | $this->ifragment = null; |
1110 | - } |
|
1111 | - else |
|
1073 | + } else |
|
1112 | 1074 | { |
1113 | 1075 | $this->ifragment = $this->replace_invalid_with_pct_encoding($ifragment, '!$&\'()*+,;=:@/?'); |
1114 | 1076 | $this->scheme_normalization(); |
@@ -1165,8 +1127,7 @@ discard block |
||
1165 | 1127 | if ($this->ipath !== '') |
1166 | 1128 | { |
1167 | 1129 | $iri .= $this->ipath; |
1168 | - } |
|
1169 | - elseif (!empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '') |
|
1130 | + } elseif (!empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '') |
|
1170 | 1131 | { |
1171 | 1132 | $iri .= $this->normalization[$this->scheme]['ipath']; |
1172 | 1133 | } |
@@ -1215,8 +1176,7 @@ discard block |
||
1215 | 1176 | $iauthority .= ':' . $this->port; |
1216 | 1177 | } |
1217 | 1178 | return $iauthority; |
1218 | - } |
|
1219 | - else |
|
1179 | + } else |
|
1220 | 1180 | { |
1221 | 1181 | return null; |
1222 | 1182 | } |
@@ -1230,9 +1190,10 @@ discard block |
||
1230 | 1190 | protected function get_authority() |
1231 | 1191 | { |
1232 | 1192 | $iauthority = $this->get_iauthority(); |
1233 | - if (is_string($iauthority)) |
|
1234 | - return $this->to_uri($iauthority); |
|
1235 | - else |
|
1236 | - return $iauthority; |
|
1193 | + if (is_string($iauthority)) { |
|
1194 | + return $this->to_uri($iauthority); |
|
1195 | + } else { |
|
1196 | + return $iauthority; |
|
1197 | + } |
|
1237 | 1198 | } |
1238 | 1199 | } |
@@ -1,46 +1,46 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * SimplePie |
|
4 | - * |
|
5 | - * A PHP-Based RSS and Atom Feed Framework. |
|
6 | - * Takes the hard work out of managing a complete RSS/Atom solution. |
|
7 | - * |
|
8 | - * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors |
|
9 | - * All rights reserved. |
|
10 | - * |
|
11 | - * Redistribution and use in source and binary forms, with or without modification, are |
|
12 | - * permitted provided that the following conditions are met: |
|
13 | - * |
|
14 | - * * Redistributions of source code must retain the above copyright notice, this list of |
|
15 | - * conditions and the following disclaimer. |
|
16 | - * |
|
17 | - * * Redistributions in binary form must reproduce the above copyright notice, this list |
|
18 | - * of conditions and the following disclaimer in the documentation and/or other materials |
|
19 | - * provided with the distribution. |
|
20 | - * |
|
21 | - * * Neither the name of the SimplePie Team nor the names of its contributors may be used |
|
22 | - * to endorse or promote products derived from this software without specific prior |
|
23 | - * written permission. |
|
24 | - * |
|
25 | - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
|
26 | - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
27 | - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS |
|
28 | - * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
29 | - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
30 | - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
31 | - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
32 | - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
33 | - * POSSIBILITY OF SUCH DAMAGE. |
|
34 | - * |
|
35 | - * @package SimplePie |
|
36 | - * @version 1.3.1 |
|
37 | - * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue |
|
38 | - * @author Ryan Parman |
|
39 | - * @author Geoffrey Sneddon |
|
40 | - * @author Ryan McCue |
|
41 | - * @link http://simplepie.org/ SimplePie |
|
42 | - * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
43 | - */ |
|
3 | + * SimplePie |
|
4 | + * |
|
5 | + * A PHP-Based RSS and Atom Feed Framework. |
|
6 | + * Takes the hard work out of managing a complete RSS/Atom solution. |
|
7 | + * |
|
8 | + * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors |
|
9 | + * All rights reserved. |
|
10 | + * |
|
11 | + * Redistribution and use in source and binary forms, with or without modification, are |
|
12 | + * permitted provided that the following conditions are met: |
|
13 | + * |
|
14 | + * * Redistributions of source code must retain the above copyright notice, this list of |
|
15 | + * conditions and the following disclaimer. |
|
16 | + * |
|
17 | + * * Redistributions in binary form must reproduce the above copyright notice, this list |
|
18 | + * of conditions and the following disclaimer in the documentation and/or other materials |
|
19 | + * provided with the distribution. |
|
20 | + * |
|
21 | + * * Neither the name of the SimplePie Team nor the names of its contributors may be used |
|
22 | + * to endorse or promote products derived from this software without specific prior |
|
23 | + * written permission. |
|
24 | + * |
|
25 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
|
26 | + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
27 | + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS |
|
28 | + * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
29 | + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
30 | + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
31 | + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
32 | + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
33 | + * POSSIBILITY OF SUCH DAMAGE. |
|
34 | + * |
|
35 | + * @package SimplePie |
|
36 | + * @version 1.3.1 |
|
37 | + * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue |
|
38 | + * @author Ryan Parman |
|
39 | + * @author Geoffrey Sneddon |
|
40 | + * @author Ryan McCue |
|
41 | + * @link http://simplepie.org/ SimplePie |
|
42 | + * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
43 | + */ |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Manages all author-related data |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | * @since 1.0 |
861 | 861 | * |
862 | 862 | * @param string $date_format Supports any PHP date format from {@see http://php.net/strftime} (empty for the raw data) |
863 | - * @return int|string|null |
|
863 | + * @return string|null |
|
864 | 864 | */ |
865 | 865 | public function get_local_date($date_format = '%c') |
866 | 866 | { |
@@ -883,7 +883,7 @@ discard block |
||
883 | 883 | * |
884 | 884 | * @see get_date |
885 | 885 | * @param string $date_format Supports any PHP date format from {@see http://php.net/date} |
886 | - * @return int|string|null |
|
886 | + * @return null|string |
|
887 | 887 | */ |
888 | 888 | public function get_gmdate($date_format = 'j F Y, g:i a') |
889 | 889 | { |
@@ -901,7 +901,7 @@ discard block |
||
901 | 901 | * |
902 | 902 | * @see get_updated_date |
903 | 903 | * @param string $date_format Supports any PHP date format from {@see http://php.net/date} |
904 | - * @return int|string|null |
|
904 | + * @return null|string |
|
905 | 905 | */ |
906 | 906 | public function get_updated_gmdate($date_format = 'j F Y, g:i a') |
907 | 907 | { |
@@ -2893,7 +2893,7 @@ discard block |
||
2893 | 2893 | * @since 1.0 |
2894 | 2894 | * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo |
2895 | 2895 | * @link http://www.georss.org/ GeoRSS |
2896 | - * @return string|null |
|
2896 | + * @return double|null |
|
2897 | 2897 | */ |
2898 | 2898 | public function get_latitude() |
2899 | 2899 | { |
@@ -2921,7 +2921,7 @@ discard block |
||
2921 | 2921 | * @since 1.0 |
2922 | 2922 | * @link http://www.w3.org/2003/01/geo/ W3C WGS84 Basic Geo |
2923 | 2923 | * @link http://www.georss.org/ GeoRSS |
2924 | - * @return string|null |
|
2924 | + * @return double|null |
|
2925 | 2925 | */ |
2926 | 2926 | public function get_longitude() |
2927 | 2927 | { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function __destruct() |
124 | 124 | { |
125 | - if ((version_compare(PHP_VERSION, '5.3', '<') || !gc_enabled()) && !ini_get('zend.ze1_compatibility_mode')) |
|
125 | + if ((version_compare(PHP_VERSION, '5.3', '<') || ! gc_enabled()) && ! ini_get('zend.ze1_compatibility_mode')) |
|
126 | 126 | { |
127 | 127 | unset($this->feed); |
128 | 128 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function get_id($hash = false) |
214 | 214 | { |
215 | - if (!$hash) |
|
215 | + if ( ! $hash) |
|
216 | 216 | { |
217 | 217 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'id')) |
218 | 218 | { |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | } |
250 | 250 | if ($this->get_permalink() !== null || $this->get_title() !== null) |
251 | 251 | { |
252 | - return md5($this->get_permalink() . $this->get_title()); |
|
252 | + return md5($this->get_permalink().$this->get_title()); |
|
253 | 253 | } |
254 | 254 | else |
255 | 255 | { |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | */ |
268 | 268 | public function get_title() |
269 | 269 | { |
270 | - if (!isset($this->data['title'])) |
|
270 | + if ( ! isset($this->data['title'])) |
|
271 | 271 | { |
272 | 272 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title')) |
273 | 273 | { |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML); |
360 | 360 | } |
361 | 361 | |
362 | - elseif (!$description_only) |
|
362 | + elseif ( ! $description_only) |
|
363 | 363 | { |
364 | 364 | return $this->get_content(true); |
365 | 365 | } |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | { |
398 | 398 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); |
399 | 399 | } |
400 | - elseif (!$content_only) |
|
400 | + elseif ( ! $content_only) |
|
401 | 401 | { |
402 | 402 | return $this->get_description(true); |
403 | 403 | } |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); |
483 | 483 | } |
484 | 484 | |
485 | - if (!empty($categories)) |
|
485 | + if ( ! empty($categories)) |
|
486 | 486 | { |
487 | 487 | return array_unique($categories); |
488 | 488 | } |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | } |
589 | 589 | } |
590 | 590 | |
591 | - if (!empty($contributors)) |
|
591 | + if ( ! empty($contributors)) |
|
592 | 592 | { |
593 | 593 | return array_unique($contributors); |
594 | 594 | } |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); |
671 | 671 | } |
672 | 672 | |
673 | - if (!empty($authors)) |
|
673 | + if ( ! empty($authors)) |
|
674 | 674 | { |
675 | 675 | return array_unique($authors); |
676 | 676 | } |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | */ |
733 | 733 | public function get_date($date_format = 'j F Y, g:i a') |
734 | 734 | { |
735 | - if (!isset($this->data['date'])) |
|
735 | + if ( ! isset($this->data['date'])) |
|
736 | 736 | { |
737 | 737 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published')) |
738 | 738 | { |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | $this->data['date']['raw'] = $return[0]['data']; |
768 | 768 | } |
769 | 769 | |
770 | - if (!empty($this->data['date']['raw'])) |
|
770 | + if ( ! empty($this->data['date']['raw'])) |
|
771 | 771 | { |
772 | 772 | $parser = $this->registry->call('Parse_Date', 'get'); |
773 | 773 | $this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']); |
@@ -811,14 +811,14 @@ discard block |
||
811 | 811 | */ |
812 | 812 | public function get_updated_date($date_format = 'j F Y, g:i a') |
813 | 813 | { |
814 | - if (!isset($this->data['updated'])) |
|
814 | + if ( ! isset($this->data['updated'])) |
|
815 | 815 | { |
816 | 816 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated')) |
817 | 817 | { |
818 | 818 | $this->data['updated']['raw'] = $return[0]['data']; |
819 | 819 | } |
820 | 820 | |
821 | - if (!empty($this->data['updated']['raw'])) |
|
821 | + if ( ! empty($this->data['updated']['raw'])) |
|
822 | 822 | { |
823 | 823 | $parser = $this->registry->call('Parse_Date', 'get'); |
824 | 824 | $this->data['updated']['parsed'] = $parser->parse($this->data['date']['raw']); |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | */ |
865 | 865 | public function get_local_date($date_format = '%c') |
866 | 866 | { |
867 | - if (!$date_format) |
|
867 | + if ( ! $date_format) |
|
868 | 868 | { |
869 | 869 | return $this->sanitize($this->get_date(''), SIMPLEPIE_CONSTRUCT_TEXT); |
870 | 870 | } |
@@ -974,7 +974,7 @@ discard block |
||
974 | 974 | */ |
975 | 975 | public function get_links($rel = 'alternate') |
976 | 976 | { |
977 | - if (!isset($this->data['links'])) |
|
977 | + if ( ! isset($this->data['links'])) |
|
978 | 978 | { |
979 | 979 | $this->data['links'] = array(); |
980 | 980 | foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link) |
@@ -1008,7 +1008,7 @@ discard block |
||
1008 | 1008 | } |
1009 | 1009 | if ($links = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid')) |
1010 | 1010 | { |
1011 | - if (!isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true') |
|
1011 | + if ( ! isset($links[0]['attribs']['']['isPermaLink']) || strtolower(trim($links[0]['attribs']['']['isPermaLink'])) === 'true') |
|
1012 | 1012 | { |
1013 | 1013 | $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); |
1014 | 1014 | } |
@@ -1019,19 +1019,19 @@ discard block |
||
1019 | 1019 | { |
1020 | 1020 | if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key))) |
1021 | 1021 | { |
1022 | - if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key])) |
|
1022 | + if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key])) |
|
1023 | 1023 | { |
1024 | - $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); |
|
1025 | - $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; |
|
1024 | + $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]); |
|
1025 | + $this->data['links'][$key] = & $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]; |
|
1026 | 1026 | } |
1027 | 1027 | else |
1028 | 1028 | { |
1029 | - $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; |
|
1029 | + $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = & $this->data['links'][$key]; |
|
1030 | 1030 | } |
1031 | 1031 | } |
1032 | 1032 | elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) |
1033 | 1033 | { |
1034 | - $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; |
|
1034 | + $this->data['links'][substr($key, 41)] = & $this->data['links'][$key]; |
|
1035 | 1035 | } |
1036 | 1036 | $this->data['links'][$key] = array_unique($this->data['links'][$key]); |
1037 | 1037 | } |
@@ -1085,7 +1085,7 @@ discard block |
||
1085 | 1085 | */ |
1086 | 1086 | public function get_enclosures() |
1087 | 1087 | { |
1088 | - if (!isset($this->data['enclosures'])) |
|
1088 | + if ( ! isset($this->data['enclosures'])) |
|
1089 | 1089 | { |
1090 | 1090 | $this->data['enclosures'] = array(); |
1091 | 1091 | |
@@ -1732,7 +1732,7 @@ discard block |
||
1732 | 1732 | // If we have media:group tags, loop through them. |
1733 | 1733 | foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group') as $group) |
1734 | 1734 | { |
1735 | - if(isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'])) |
|
1735 | + if (isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'])) |
|
1736 | 1736 | { |
1737 | 1737 | // If we have media:content tags, loop through them. |
1738 | 1738 | foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content) |
@@ -2762,7 +2762,7 @@ discard block |
||
2762 | 2762 | |
2763 | 2763 | foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link') as $link) |
2764 | 2764 | { |
2765 | - if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure') |
|
2765 | + if (isset($link['attribs']['']['href']) && ! empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure') |
|
2766 | 2766 | { |
2767 | 2767 | // Attributes |
2768 | 2768 | $bitrate = null; |
@@ -2797,7 +2797,7 @@ discard block |
||
2797 | 2797 | |
2798 | 2798 | foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link') as $link) |
2799 | 2799 | { |
2800 | - if (isset($link['attribs']['']['href']) && !empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure') |
|
2800 | + if (isset($link['attribs']['']['href']) && ! empty($link['attribs']['']['rel']) && $link['attribs']['']['rel'] === 'enclosure') |
|
2801 | 2801 | { |
2802 | 2802 | // Attributes |
2803 | 2803 | $bitrate = null; |
@@ -2873,7 +2873,7 @@ discard block |
||
2873 | 2873 | |
2874 | 2874 | $this->data['enclosures'] = array_values(array_unique($this->data['enclosures'])); |
2875 | 2875 | } |
2876 | - if (!empty($this->data['enclosures'])) |
|
2876 | + if ( ! empty($this->data['enclosures'])) |
|
2877 | 2877 | { |
2878 | 2878 | return $this->data['enclosures']; |
2879 | 2879 | } |
@@ -147,8 +147,7 @@ discard block |
||
147 | 147 | if (isset($this->data['child'][$namespace][$tag])) |
148 | 148 | { |
149 | 149 | return $this->data['child'][$namespace][$tag]; |
150 | - } |
|
151 | - else |
|
150 | + } else |
|
152 | 151 | { |
153 | 152 | return null; |
154 | 153 | } |
@@ -217,32 +216,25 @@ discard block |
||
217 | 216 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'id')) |
218 | 217 | { |
219 | 218 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
220 | - } |
|
221 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'id')) |
|
219 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'id')) |
|
222 | 220 | { |
223 | 221 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
224 | - } |
|
225 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid')) |
|
222 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid')) |
|
226 | 223 | { |
227 | 224 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
228 | - } |
|
229 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'identifier')) |
|
225 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'identifier')) |
|
230 | 226 | { |
231 | 227 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
232 | - } |
|
233 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'identifier')) |
|
228 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'identifier')) |
|
234 | 229 | { |
235 | 230 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
236 | - } |
|
237 | - elseif (isset($this->data['attribs'][SIMPLEPIE_NAMESPACE_RDF]['about'])) |
|
231 | + } elseif (isset($this->data['attribs'][SIMPLEPIE_NAMESPACE_RDF]['about'])) |
|
238 | 232 | { |
239 | 233 | return $this->sanitize($this->data['attribs'][SIMPLEPIE_NAMESPACE_RDF]['about'], SIMPLEPIE_CONSTRUCT_TEXT); |
240 | - } |
|
241 | - elseif (($return = $this->get_permalink()) !== null) |
|
234 | + } elseif (($return = $this->get_permalink()) !== null) |
|
242 | 235 | { |
243 | 236 | return $return; |
244 | - } |
|
245 | - elseif (($return = $this->get_title()) !== null) |
|
237 | + } elseif (($return = $this->get_title()) !== null) |
|
246 | 238 | { |
247 | 239 | return $return; |
248 | 240 | } |
@@ -250,8 +242,7 @@ discard block |
||
250 | 242 | if ($this->get_permalink() !== null || $this->get_title() !== null) |
251 | 243 | { |
252 | 244 | return md5($this->get_permalink() . $this->get_title()); |
253 | - } |
|
254 | - else |
|
245 | + } else |
|
255 | 246 | { |
256 | 247 | return md5(serialize($this->data)); |
257 | 248 | } |
@@ -272,32 +263,25 @@ discard block |
||
272 | 263 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title')) |
273 | 264 | { |
274 | 265 | $this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
275 | - } |
|
276 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title')) |
|
266 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title')) |
|
277 | 267 | { |
278 | 268 | $this->data['title'] = $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
279 | - } |
|
280 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) |
|
269 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) |
|
281 | 270 | { |
282 | 271 | $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); |
283 | - } |
|
284 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) |
|
272 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) |
|
285 | 273 | { |
286 | 274 | $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); |
287 | - } |
|
288 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) |
|
275 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) |
|
289 | 276 | { |
290 | 277 | $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); |
291 | - } |
|
292 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) |
|
278 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) |
|
293 | 279 | { |
294 | 280 | $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
295 | - } |
|
296 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) |
|
281 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) |
|
297 | 282 | { |
298 | 283 | $this->data['title'] = $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
299 | - } |
|
300 | - else |
|
284 | + } else |
|
301 | 285 | { |
302 | 286 | $this->data['title'] = null; |
303 | 287 | } |
@@ -325,45 +309,34 @@ discard block |
||
325 | 309 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'summary')) |
326 | 310 | { |
327 | 311 | return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
328 | - } |
|
329 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'summary')) |
|
312 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'summary')) |
|
330 | 313 | { |
331 | 314 | return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
332 | - } |
|
333 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) |
|
315 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) |
|
334 | 316 | { |
335 | 317 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); |
336 | - } |
|
337 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) |
|
318 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) |
|
338 | 319 | { |
339 | 320 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); |
340 | - } |
|
341 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) |
|
321 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) |
|
342 | 322 | { |
343 | 323 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
344 | - } |
|
345 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) |
|
324 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) |
|
346 | 325 | { |
347 | 326 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
348 | - } |
|
349 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) |
|
327 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) |
|
350 | 328 | { |
351 | 329 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); |
352 | - } |
|
353 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) |
|
330 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) |
|
354 | 331 | { |
355 | 332 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
356 | - } |
|
357 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) |
|
333 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) |
|
358 | 334 | { |
359 | 335 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML); |
360 | - } |
|
361 | - |
|
362 | - elseif (!$description_only) |
|
336 | + } elseif (!$description_only) |
|
363 | 337 | { |
364 | 338 | return $this->get_content(true); |
365 | - } |
|
366 | - else |
|
339 | + } else |
|
367 | 340 | { |
368 | 341 | return null; |
369 | 342 | } |
@@ -388,20 +361,16 @@ discard block |
||
388 | 361 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'content')) |
389 | 362 | { |
390 | 363 | return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_content_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
391 | - } |
|
392 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'content')) |
|
364 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'content')) |
|
393 | 365 | { |
394 | 366 | return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
395 | - } |
|
396 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT, 'encoded')) |
|
367 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT, 'encoded')) |
|
397 | 368 | { |
398 | 369 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); |
399 | - } |
|
400 | - elseif (!$content_only) |
|
370 | + } elseif (!$content_only) |
|
401 | 371 | { |
402 | 372 | return $this->get_description(true); |
403 | - } |
|
404 | - else |
|
373 | + } else |
|
405 | 374 | { |
406 | 375 | return null; |
407 | 376 | } |
@@ -420,8 +389,7 @@ discard block |
||
420 | 389 | if (isset($categories[$key])) |
421 | 390 | { |
422 | 391 | return $categories[$key]; |
423 | - } |
|
424 | - else |
|
392 | + } else |
|
425 | 393 | { |
426 | 394 | return null; |
427 | 395 | } |
@@ -466,8 +434,7 @@ discard block |
||
466 | 434 | if (isset($category['attribs']['']['domain'])) |
467 | 435 | { |
468 | 436 | $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); |
469 | - } |
|
470 | - else |
|
437 | + } else |
|
471 | 438 | { |
472 | 439 | $scheme = null; |
473 | 440 | } |
@@ -485,8 +452,7 @@ discard block |
||
485 | 452 | if (!empty($categories)) |
486 | 453 | { |
487 | 454 | return array_unique($categories); |
488 | - } |
|
489 | - else |
|
455 | + } else |
|
490 | 456 | { |
491 | 457 | return null; |
492 | 458 | } |
@@ -505,8 +471,7 @@ discard block |
||
505 | 471 | if (isset($authors[$key])) |
506 | 472 | { |
507 | 473 | return $authors[$key]; |
508 | - } |
|
509 | - else |
|
474 | + } else |
|
510 | 475 | { |
511 | 476 | return null; |
512 | 477 | } |
@@ -525,8 +490,7 @@ discard block |
||
525 | 490 | if (isset($contributors[$key])) |
526 | 491 | { |
527 | 492 | return $contributors[$key]; |
528 | - } |
|
529 | - else |
|
493 | + } else |
|
530 | 494 | { |
531 | 495 | return null; |
532 | 496 | } |
@@ -591,8 +555,7 @@ discard block |
||
591 | 555 | if (!empty($contributors)) |
592 | 556 | { |
593 | 557 | return array_unique($contributors); |
594 | - } |
|
595 | - else |
|
558 | + } else |
|
596 | 559 | { |
597 | 560 | return null; |
598 | 561 | } |
@@ -673,16 +636,13 @@ discard block |
||
673 | 636 | if (!empty($authors)) |
674 | 637 | { |
675 | 638 | return array_unique($authors); |
676 | - } |
|
677 | - elseif (($source = $this->get_source()) && ($authors = $source->get_authors())) |
|
639 | + } elseif (($source = $this->get_source()) && ($authors = $source->get_authors())) |
|
678 | 640 | { |
679 | 641 | return $authors; |
680 | - } |
|
681 | - elseif ($authors = $this->feed->get_authors()) |
|
642 | + } elseif ($authors = $this->feed->get_authors()) |
|
682 | 643 | { |
683 | 644 | return $authors; |
684 | - } |
|
685 | - else |
|
645 | + } else |
|
686 | 646 | { |
687 | 647 | return null; |
688 | 648 | } |
@@ -701,16 +661,13 @@ discard block |
||
701 | 661 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights')) |
702 | 662 | { |
703 | 663 | return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); |
704 | - } |
|
705 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights')) |
|
664 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights')) |
|
706 | 665 | { |
707 | 666 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
708 | - } |
|
709 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights')) |
|
667 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights')) |
|
710 | 668 | { |
711 | 669 | return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
712 | - } |
|
713 | - else |
|
670 | + } else |
|
714 | 671 | { |
715 | 672 | return null; |
716 | 673 | } |
@@ -737,32 +694,25 @@ discard block |
||
737 | 694 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published')) |
738 | 695 | { |
739 | 696 | $this->data['date']['raw'] = $return[0]['data']; |
740 | - } |
|
741 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated')) |
|
697 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated')) |
|
742 | 698 | { |
743 | 699 | $this->data['date']['raw'] = $return[0]['data']; |
744 | - } |
|
745 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued')) |
|
700 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued')) |
|
746 | 701 | { |
747 | 702 | $this->data['date']['raw'] = $return[0]['data']; |
748 | - } |
|
749 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created')) |
|
703 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created')) |
|
750 | 704 | { |
751 | 705 | $this->data['date']['raw'] = $return[0]['data']; |
752 | - } |
|
753 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified')) |
|
706 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified')) |
|
754 | 707 | { |
755 | 708 | $this->data['date']['raw'] = $return[0]['data']; |
756 | - } |
|
757 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate')) |
|
709 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pubDate')) |
|
758 | 710 | { |
759 | 711 | $this->data['date']['raw'] = $return[0]['data']; |
760 | - } |
|
761 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date')) |
|
712 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date')) |
|
762 | 713 | { |
763 | 714 | $this->data['date']['raw'] = $return[0]['data']; |
764 | - } |
|
765 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date')) |
|
715 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date')) |
|
766 | 716 | { |
767 | 717 | $this->data['date']['raw'] = $return[0]['data']; |
768 | 718 | } |
@@ -771,8 +721,7 @@ discard block |
||
771 | 721 | { |
772 | 722 | $parser = $this->registry->call('Parse_Date', 'get'); |
773 | 723 | $this->data['date']['parsed'] = $parser->parse($this->data['date']['raw']); |
774 | - } |
|
775 | - else |
|
724 | + } else |
|
776 | 725 | { |
777 | 726 | $this->data['date'] = null; |
778 | 727 | } |
@@ -791,8 +740,7 @@ discard block |
||
791 | 740 | default: |
792 | 741 | return date($date_format, $this->data['date']['parsed']); |
793 | 742 | } |
794 | - } |
|
795 | - else |
|
743 | + } else |
|
796 | 744 | { |
797 | 745 | return null; |
798 | 746 | } |
@@ -822,8 +770,7 @@ discard block |
||
822 | 770 | { |
823 | 771 | $parser = $this->registry->call('Parse_Date', 'get'); |
824 | 772 | $this->data['updated']['parsed'] = $parser->parse($this->data['date']['raw']); |
825 | - } |
|
826 | - else |
|
773 | + } else |
|
827 | 774 | { |
828 | 775 | $this->data['updated'] = null; |
829 | 776 | } |
@@ -842,8 +789,7 @@ discard block |
||
842 | 789 | default: |
843 | 790 | return date($date_format, $this->data['updated']['parsed']); |
844 | 791 | } |
845 | - } |
|
846 | - else |
|
792 | + } else |
|
847 | 793 | { |
848 | 794 | return null; |
849 | 795 | } |
@@ -867,12 +813,10 @@ discard block |
||
867 | 813 | if (!$date_format) |
868 | 814 | { |
869 | 815 | return $this->sanitize($this->get_date(''), SIMPLEPIE_CONSTRUCT_TEXT); |
870 | - } |
|
871 | - elseif (($date = $this->get_date('U')) !== null && $date !== false) |
|
816 | + } elseif (($date = $this->get_date('U')) !== null && $date !== false) |
|
872 | 817 | { |
873 | 818 | return strftime($date_format, $date); |
874 | - } |
|
875 | - else |
|
819 | + } else |
|
876 | 820 | { |
877 | 821 | return null; |
878 | 822 | } |
@@ -931,12 +875,10 @@ discard block |
||
931 | 875 | if ($link !== null) |
932 | 876 | { |
933 | 877 | return $link; |
934 | - } |
|
935 | - elseif ($enclosure !== null) |
|
878 | + } elseif ($enclosure !== null) |
|
936 | 879 | { |
937 | 880 | return $enclosure->get_link(); |
938 | - } |
|
939 | - else |
|
881 | + } else |
|
940 | 882 | { |
941 | 883 | return null; |
942 | 884 | } |
@@ -956,8 +898,7 @@ discard block |
||
956 | 898 | if ($links[$key] !== null) |
957 | 899 | { |
958 | 900 | return $links[$key]; |
959 | - } |
|
960 | - else |
|
901 | + } else |
|
961 | 902 | { |
962 | 903 | return null; |
963 | 904 | } |
@@ -1023,13 +964,11 @@ discard block |
||
1023 | 964 | { |
1024 | 965 | $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); |
1025 | 966 | $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; |
1026 | - } |
|
1027 | - else |
|
967 | + } else |
|
1028 | 968 | { |
1029 | 969 | $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; |
1030 | 970 | } |
1031 | - } |
|
1032 | - elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) |
|
971 | + } elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) |
|
1033 | 972 | { |
1034 | 973 | $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; |
1035 | 974 | } |
@@ -1039,8 +978,7 @@ discard block |
||
1039 | 978 | if (isset($this->data['links'][$rel])) |
1040 | 979 | { |
1041 | 980 | return $this->data['links'][$rel]; |
1042 | - } |
|
1043 | - else |
|
981 | + } else |
|
1044 | 982 | { |
1045 | 983 | return null; |
1046 | 984 | } |
@@ -1062,8 +1000,7 @@ discard block |
||
1062 | 1000 | if (isset($enclosures[$key])) |
1063 | 1001 | { |
1064 | 1002 | return $enclosures[$key]; |
1065 | - } |
|
1066 | - else |
|
1003 | + } else |
|
1067 | 1004 | { |
1068 | 1005 | return null; |
1069 | 1006 | } |
@@ -1139,8 +1076,7 @@ discard block |
||
1139 | 1076 | } |
1140 | 1077 | $captions_parent[] = $this->registry->create('Caption', array($caption_type, $caption_lang, $caption_startTime, $caption_endTime, $caption_text)); |
1141 | 1078 | } |
1142 | - } |
|
1143 | - elseif ($captions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text')) |
|
1079 | + } elseif ($captions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'text')) |
|
1144 | 1080 | { |
1145 | 1081 | foreach ($captions as $caption) |
1146 | 1082 | { |
@@ -1190,8 +1126,7 @@ discard block |
||
1190 | 1126 | if (isset($category['attribs']['']['scheme'])) |
1191 | 1127 | { |
1192 | 1128 | $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
1193 | - } |
|
1194 | - else |
|
1129 | + } else |
|
1195 | 1130 | { |
1196 | 1131 | $scheme = 'http://search.yahoo.com/mrss/category_schema'; |
1197 | 1132 | } |
@@ -1213,8 +1148,7 @@ discard block |
||
1213 | 1148 | if (isset($category['attribs']['']['scheme'])) |
1214 | 1149 | { |
1215 | 1150 | $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
1216 | - } |
|
1217 | - else |
|
1151 | + } else |
|
1218 | 1152 | { |
1219 | 1153 | $scheme = 'http://search.yahoo.com/mrss/category_schema'; |
1220 | 1154 | } |
@@ -1266,8 +1200,7 @@ discard block |
||
1266 | 1200 | $copyright_label = $this->sanitize($copyright[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
1267 | 1201 | } |
1268 | 1202 | $copyrights_parent = $this->registry->create('Copyright', array($copyright_url, $copyright_label)); |
1269 | - } |
|
1270 | - elseif ($copyright = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright')) |
|
1203 | + } elseif ($copyright = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'copyright')) |
|
1271 | 1204 | { |
1272 | 1205 | $copyright_url = null; |
1273 | 1206 | $copyright_label = null; |
@@ -1297,8 +1230,7 @@ discard block |
||
1297 | 1230 | if (isset($credit['attribs']['']['scheme'])) |
1298 | 1231 | { |
1299 | 1232 | $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
1300 | - } |
|
1301 | - else |
|
1233 | + } else |
|
1302 | 1234 | { |
1303 | 1235 | $credit_scheme = 'urn:ebu'; |
1304 | 1236 | } |
@@ -1308,8 +1240,7 @@ discard block |
||
1308 | 1240 | } |
1309 | 1241 | $credits_parent[] = $this->registry->create('Credit', array($credit_role, $credit_scheme, $credit_name)); |
1310 | 1242 | } |
1311 | - } |
|
1312 | - elseif ($credits = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit')) |
|
1243 | + } elseif ($credits = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'credit')) |
|
1313 | 1244 | { |
1314 | 1245 | foreach ($credits as $credit) |
1315 | 1246 | { |
@@ -1323,8 +1254,7 @@ discard block |
||
1323 | 1254 | if (isset($credit['attribs']['']['scheme'])) |
1324 | 1255 | { |
1325 | 1256 | $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
1326 | - } |
|
1327 | - else |
|
1257 | + } else |
|
1328 | 1258 | { |
1329 | 1259 | $credit_scheme = 'urn:ebu'; |
1330 | 1260 | } |
@@ -1347,8 +1277,7 @@ discard block |
||
1347 | 1277 | { |
1348 | 1278 | $description_parent = $this->sanitize($description_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
1349 | 1279 | } |
1350 | - } |
|
1351 | - elseif ($description_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description')) |
|
1280 | + } elseif ($description_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'description')) |
|
1352 | 1281 | { |
1353 | 1282 | if (isset($description_parent[0]['data'])) |
1354 | 1283 | { |
@@ -1398,15 +1327,13 @@ discard block |
||
1398 | 1327 | if (isset($hash['attribs']['']['algo'])) |
1399 | 1328 | { |
1400 | 1329 | $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); |
1401 | - } |
|
1402 | - else |
|
1330 | + } else |
|
1403 | 1331 | { |
1404 | 1332 | $algo = 'md5'; |
1405 | 1333 | } |
1406 | 1334 | $hashes_parent[] = $algo.':'.$value; |
1407 | 1335 | } |
1408 | - } |
|
1409 | - elseif ($hashes_iterator = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash')) |
|
1336 | + } elseif ($hashes_iterator = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'hash')) |
|
1410 | 1337 | { |
1411 | 1338 | foreach ($hashes_iterator as $hash) |
1412 | 1339 | { |
@@ -1419,8 +1346,7 @@ discard block |
||
1419 | 1346 | if (isset($hash['attribs']['']['algo'])) |
1420 | 1347 | { |
1421 | 1348 | $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); |
1422 | - } |
|
1423 | - else |
|
1349 | + } else |
|
1424 | 1350 | { |
1425 | 1351 | $algo = 'md5'; |
1426 | 1352 | } |
@@ -1444,8 +1370,7 @@ discard block |
||
1444 | 1370 | } |
1445 | 1371 | } |
1446 | 1372 | unset($temp); |
1447 | - } |
|
1448 | - elseif ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords')) |
|
1373 | + } elseif ($keywords = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords')) |
|
1449 | 1374 | { |
1450 | 1375 | if (isset($keywords[0]['data'])) |
1451 | 1376 | { |
@@ -1456,8 +1381,7 @@ discard block |
||
1456 | 1381 | } |
1457 | 1382 | } |
1458 | 1383 | unset($temp); |
1459 | - } |
|
1460 | - elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords')) |
|
1384 | + } elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'keywords')) |
|
1461 | 1385 | { |
1462 | 1386 | if (isset($keywords[0]['data'])) |
1463 | 1387 | { |
@@ -1468,8 +1392,7 @@ discard block |
||
1468 | 1392 | } |
1469 | 1393 | } |
1470 | 1394 | unset($temp); |
1471 | - } |
|
1472 | - elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords')) |
|
1395 | + } elseif ($keywords = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'keywords')) |
|
1473 | 1396 | { |
1474 | 1397 | if (isset($keywords[0]['data'])) |
1475 | 1398 | { |
@@ -1493,8 +1416,7 @@ discard block |
||
1493 | 1416 | { |
1494 | 1417 | $player_parent = $this->sanitize($player_parent[0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); |
1495 | 1418 | } |
1496 | - } |
|
1497 | - elseif ($player_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player')) |
|
1419 | + } elseif ($player_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'player')) |
|
1498 | 1420 | { |
1499 | 1421 | if (isset($player_parent[0]['attribs']['']['url'])) |
1500 | 1422 | { |
@@ -1512,8 +1434,7 @@ discard block |
||
1512 | 1434 | if (isset($rating['attribs']['']['scheme'])) |
1513 | 1435 | { |
1514 | 1436 | $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
1515 | - } |
|
1516 | - else |
|
1437 | + } else |
|
1517 | 1438 | { |
1518 | 1439 | $rating_scheme = 'urn:simple'; |
1519 | 1440 | } |
@@ -1523,8 +1444,7 @@ discard block |
||
1523 | 1444 | } |
1524 | 1445 | $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value)); |
1525 | 1446 | } |
1526 | - } |
|
1527 | - elseif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit')) |
|
1447 | + } elseif ($ratings = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit')) |
|
1528 | 1448 | { |
1529 | 1449 | foreach ($ratings as $rating) |
1530 | 1450 | { |
@@ -1536,8 +1456,7 @@ discard block |
||
1536 | 1456 | } |
1537 | 1457 | $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value)); |
1538 | 1458 | } |
1539 | - } |
|
1540 | - elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating')) |
|
1459 | + } elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'rating')) |
|
1541 | 1460 | { |
1542 | 1461 | foreach ($ratings as $rating) |
1543 | 1462 | { |
@@ -1546,8 +1465,7 @@ discard block |
||
1546 | 1465 | if (isset($rating['attribs']['']['scheme'])) |
1547 | 1466 | { |
1548 | 1467 | $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
1549 | - } |
|
1550 | - else |
|
1468 | + } else |
|
1551 | 1469 | { |
1552 | 1470 | $rating_scheme = 'urn:simple'; |
1553 | 1471 | } |
@@ -1557,8 +1475,7 @@ discard block |
||
1557 | 1475 | } |
1558 | 1476 | $ratings_parent[] = $this->registry->create('Rating', array($rating_scheme, $rating_value)); |
1559 | 1477 | } |
1560 | - } |
|
1561 | - elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit')) |
|
1478 | + } elseif ($ratings = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'explicit')) |
|
1562 | 1479 | { |
1563 | 1480 | foreach ($ratings as $rating) |
1564 | 1481 | { |
@@ -1598,8 +1515,7 @@ discard block |
||
1598 | 1515 | } |
1599 | 1516 | $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value)); |
1600 | 1517 | } |
1601 | - } |
|
1602 | - elseif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block')) |
|
1518 | + } elseif ($restrictions = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block')) |
|
1603 | 1519 | { |
1604 | 1520 | foreach ($restrictions as $restriction) |
1605 | 1521 | { |
@@ -1612,8 +1528,7 @@ discard block |
||
1612 | 1528 | } |
1613 | 1529 | $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value)); |
1614 | 1530 | } |
1615 | - } |
|
1616 | - elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction')) |
|
1531 | + } elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'restriction')) |
|
1617 | 1532 | { |
1618 | 1533 | foreach ($restrictions as $restriction) |
1619 | 1534 | { |
@@ -1634,8 +1549,7 @@ discard block |
||
1634 | 1549 | } |
1635 | 1550 | $restrictions_parent[] = $this->registry->create('Restriction', array($restriction_relationship, $restriction_type, $restriction_value)); |
1636 | 1551 | } |
1637 | - } |
|
1638 | - elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block')) |
|
1552 | + } elseif ($restrictions = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'block')) |
|
1639 | 1553 | { |
1640 | 1554 | foreach ($restrictions as $restriction) |
1641 | 1555 | { |
@@ -1652,8 +1566,7 @@ discard block |
||
1652 | 1566 | if (is_array($restrictions_parent)) |
1653 | 1567 | { |
1654 | 1568 | $restrictions_parent = array_values(array_unique($restrictions_parent)); |
1655 | - } |
|
1656 | - else |
|
1569 | + } else |
|
1657 | 1570 | { |
1658 | 1571 | $restrictions_parent = array(new SimplePie_Restriction('allow', null, 'default')); |
1659 | 1572 | } |
@@ -1668,8 +1581,7 @@ discard block |
||
1668 | 1581 | $thumbnails_parent[] = $this->sanitize($thumbnail['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); |
1669 | 1582 | } |
1670 | 1583 | } |
1671 | - } |
|
1672 | - elseif ($thumbnails = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail')) |
|
1584 | + } elseif ($thumbnails = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'thumbnail')) |
|
1673 | 1585 | { |
1674 | 1586 | foreach ($thumbnails as $thumbnail) |
1675 | 1587 | { |
@@ -1687,8 +1599,7 @@ discard block |
||
1687 | 1599 | { |
1688 | 1600 | $title_parent = $this->sanitize($title_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
1689 | 1601 | } |
1690 | - } |
|
1691 | - elseif ($title_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title')) |
|
1602 | + } elseif ($title_parent = $parent->get_channel_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'title')) |
|
1692 | 1603 | { |
1693 | 1604 | if (isset($title_parent[0]['data'])) |
1694 | 1605 | { |
@@ -1781,8 +1692,7 @@ discard block |
||
1781 | 1692 | if (isset($content['attribs']['']['duration'])) |
1782 | 1693 | { |
1783 | 1694 | $duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT); |
1784 | - } |
|
1785 | - else |
|
1695 | + } else |
|
1786 | 1696 | { |
1787 | 1697 | $duration = $duration_parent; |
1788 | 1698 | } |
@@ -1862,8 +1772,7 @@ discard block |
||
1862 | 1772 | { |
1863 | 1773 | $captions = array_values(array_unique($captions)); |
1864 | 1774 | } |
1865 | - } |
|
1866 | - elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'])) |
|
1775 | + } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'])) |
|
1867 | 1776 | { |
1868 | 1777 | foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['text'] as $caption) |
1869 | 1778 | { |
@@ -1898,8 +1807,7 @@ discard block |
||
1898 | 1807 | { |
1899 | 1808 | $captions = array_values(array_unique($captions)); |
1900 | 1809 | } |
1901 | - } |
|
1902 | - else |
|
1810 | + } else |
|
1903 | 1811 | { |
1904 | 1812 | $captions = $captions_parent; |
1905 | 1813 | } |
@@ -1919,8 +1827,7 @@ discard block |
||
1919 | 1827 | if (isset($category['attribs']['']['scheme'])) |
1920 | 1828 | { |
1921 | 1829 | $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
1922 | - } |
|
1923 | - else |
|
1830 | + } else |
|
1924 | 1831 | { |
1925 | 1832 | $scheme = 'http://search.yahoo.com/mrss/category_schema'; |
1926 | 1833 | } |
@@ -1945,8 +1852,7 @@ discard block |
||
1945 | 1852 | if (isset($category['attribs']['']['scheme'])) |
1946 | 1853 | { |
1947 | 1854 | $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
1948 | - } |
|
1949 | - else |
|
1855 | + } else |
|
1950 | 1856 | { |
1951 | 1857 | $scheme = 'http://search.yahoo.com/mrss/category_schema'; |
1952 | 1858 | } |
@@ -1960,12 +1866,10 @@ discard block |
||
1960 | 1866 | if (is_array($categories) && is_array($categories_parent)) |
1961 | 1867 | { |
1962 | 1868 | $categories = array_values(array_unique(array_merge($categories, $categories_parent))); |
1963 | - } |
|
1964 | - elseif (is_array($categories)) |
|
1869 | + } elseif (is_array($categories)) |
|
1965 | 1870 | { |
1966 | 1871 | $categories = array_values(array_unique($categories)); |
1967 | - } |
|
1968 | - elseif (is_array($categories_parent)) |
|
1872 | + } elseif (is_array($categories_parent)) |
|
1969 | 1873 | { |
1970 | 1874 | $categories = array_values(array_unique($categories_parent)); |
1971 | 1875 | } |
@@ -1984,8 +1888,7 @@ discard block |
||
1984 | 1888 | $copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
1985 | 1889 | } |
1986 | 1890 | $copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label)); |
1987 | - } |
|
1988 | - elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'])) |
|
1891 | + } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'])) |
|
1989 | 1892 | { |
1990 | 1893 | $copyright_url = null; |
1991 | 1894 | $copyright_label = null; |
@@ -1998,8 +1901,7 @@ discard block |
||
1998 | 1901 | $copyright_label = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
1999 | 1902 | } |
2000 | 1903 | $copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label)); |
2001 | - } |
|
2002 | - else |
|
1904 | + } else |
|
2003 | 1905 | { |
2004 | 1906 | $copyrights = $copyrights_parent; |
2005 | 1907 | } |
@@ -2019,8 +1921,7 @@ discard block |
||
2019 | 1921 | if (isset($credit['attribs']['']['scheme'])) |
2020 | 1922 | { |
2021 | 1923 | $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
2022 | - } |
|
2023 | - else |
|
1924 | + } else |
|
2024 | 1925 | { |
2025 | 1926 | $credit_scheme = 'urn:ebu'; |
2026 | 1927 | } |
@@ -2034,8 +1935,7 @@ discard block |
||
2034 | 1935 | { |
2035 | 1936 | $credits = array_values(array_unique($credits)); |
2036 | 1937 | } |
2037 | - } |
|
2038 | - elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'])) |
|
1938 | + } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'])) |
|
2039 | 1939 | { |
2040 | 1940 | foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['credit'] as $credit) |
2041 | 1941 | { |
@@ -2049,8 +1949,7 @@ discard block |
||
2049 | 1949 | if (isset($credit['attribs']['']['scheme'])) |
2050 | 1950 | { |
2051 | 1951 | $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
2052 | - } |
|
2053 | - else |
|
1952 | + } else |
|
2054 | 1953 | { |
2055 | 1954 | $credit_scheme = 'urn:ebu'; |
2056 | 1955 | } |
@@ -2064,8 +1963,7 @@ discard block |
||
2064 | 1963 | { |
2065 | 1964 | $credits = array_values(array_unique($credits)); |
2066 | 1965 | } |
2067 | - } |
|
2068 | - else |
|
1966 | + } else |
|
2069 | 1967 | { |
2070 | 1968 | $credits = $credits_parent; |
2071 | 1969 | } |
@@ -2074,12 +1972,10 @@ discard block |
||
2074 | 1972 | if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'])) |
2075 | 1973 | { |
2076 | 1974 | $description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
2077 | - } |
|
2078 | - elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'])) |
|
1975 | + } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'])) |
|
2079 | 1976 | { |
2080 | 1977 | $description = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
2081 | - } |
|
2082 | - else |
|
1978 | + } else |
|
2083 | 1979 | { |
2084 | 1980 | $description = $description_parent; |
2085 | 1981 | } |
@@ -2098,8 +1994,7 @@ discard block |
||
2098 | 1994 | if (isset($hash['attribs']['']['algo'])) |
2099 | 1995 | { |
2100 | 1996 | $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); |
2101 | - } |
|
2102 | - else |
|
1997 | + } else |
|
2103 | 1998 | { |
2104 | 1999 | $algo = 'md5'; |
2105 | 2000 | } |
@@ -2109,8 +2004,7 @@ discard block |
||
2109 | 2004 | { |
2110 | 2005 | $hashes = array_values(array_unique($hashes)); |
2111 | 2006 | } |
2112 | - } |
|
2113 | - elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'])) |
|
2007 | + } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'])) |
|
2114 | 2008 | { |
2115 | 2009 | foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['hash'] as $hash) |
2116 | 2010 | { |
@@ -2123,8 +2017,7 @@ discard block |
||
2123 | 2017 | if (isset($hash['attribs']['']['algo'])) |
2124 | 2018 | { |
2125 | 2019 | $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); |
2126 | - } |
|
2127 | - else |
|
2020 | + } else |
|
2128 | 2021 | { |
2129 | 2022 | $algo = 'md5'; |
2130 | 2023 | } |
@@ -2134,8 +2027,7 @@ discard block |
||
2134 | 2027 | { |
2135 | 2028 | $hashes = array_values(array_unique($hashes)); |
2136 | 2029 | } |
2137 | - } |
|
2138 | - else |
|
2030 | + } else |
|
2139 | 2031 | { |
2140 | 2032 | $hashes = $hashes_parent; |
2141 | 2033 | } |
@@ -2156,8 +2048,7 @@ discard block |
||
2156 | 2048 | { |
2157 | 2049 | $keywords = array_values(array_unique($keywords)); |
2158 | 2050 | } |
2159 | - } |
|
2160 | - elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'])) |
|
2051 | + } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'])) |
|
2161 | 2052 | { |
2162 | 2053 | if (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['keywords'][0]['data'])) |
2163 | 2054 | { |
@@ -2172,8 +2063,7 @@ discard block |
||
2172 | 2063 | { |
2173 | 2064 | $keywords = array_values(array_unique($keywords)); |
2174 | 2065 | } |
2175 | - } |
|
2176 | - else |
|
2066 | + } else |
|
2177 | 2067 | { |
2178 | 2068 | $keywords = $keywords_parent; |
2179 | 2069 | } |
@@ -2182,12 +2072,10 @@ discard block |
||
2182 | 2072 | if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'])) |
2183 | 2073 | { |
2184 | 2074 | $player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); |
2185 | - } |
|
2186 | - elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'])) |
|
2075 | + } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'])) |
|
2187 | 2076 | { |
2188 | 2077 | $player = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); |
2189 | - } |
|
2190 | - else |
|
2078 | + } else |
|
2191 | 2079 | { |
2192 | 2080 | $player = $player_parent; |
2193 | 2081 | } |
@@ -2202,8 +2090,7 @@ discard block |
||
2202 | 2090 | if (isset($rating['attribs']['']['scheme'])) |
2203 | 2091 | { |
2204 | 2092 | $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
2205 | - } |
|
2206 | - else |
|
2093 | + } else |
|
2207 | 2094 | { |
2208 | 2095 | $rating_scheme = 'urn:simple'; |
2209 | 2096 | } |
@@ -2217,8 +2104,7 @@ discard block |
||
2217 | 2104 | { |
2218 | 2105 | $ratings = array_values(array_unique($ratings)); |
2219 | 2106 | } |
2220 | - } |
|
2221 | - elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'])) |
|
2107 | + } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'])) |
|
2222 | 2108 | { |
2223 | 2109 | foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['rating'] as $rating) |
2224 | 2110 | { |
@@ -2227,8 +2113,7 @@ discard block |
||
2227 | 2113 | if (isset($rating['attribs']['']['scheme'])) |
2228 | 2114 | { |
2229 | 2115 | $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
2230 | - } |
|
2231 | - else |
|
2116 | + } else |
|
2232 | 2117 | { |
2233 | 2118 | $rating_scheme = 'urn:simple'; |
2234 | 2119 | } |
@@ -2242,8 +2127,7 @@ discard block |
||
2242 | 2127 | { |
2243 | 2128 | $ratings = array_values(array_unique($ratings)); |
2244 | 2129 | } |
2245 | - } |
|
2246 | - else |
|
2130 | + } else |
|
2247 | 2131 | { |
2248 | 2132 | $ratings = $ratings_parent; |
2249 | 2133 | } |
@@ -2274,8 +2158,7 @@ discard block |
||
2274 | 2158 | { |
2275 | 2159 | $restrictions = array_values(array_unique($restrictions)); |
2276 | 2160 | } |
2277 | - } |
|
2278 | - elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'])) |
|
2161 | + } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'])) |
|
2279 | 2162 | { |
2280 | 2163 | foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['restriction'] as $restriction) |
2281 | 2164 | { |
@@ -2300,8 +2183,7 @@ discard block |
||
2300 | 2183 | { |
2301 | 2184 | $restrictions = array_values(array_unique($restrictions)); |
2302 | 2185 | } |
2303 | - } |
|
2304 | - else |
|
2186 | + } else |
|
2305 | 2187 | { |
2306 | 2188 | $restrictions = $restrictions_parent; |
2307 | 2189 | } |
@@ -2317,8 +2199,7 @@ discard block |
||
2317 | 2199 | { |
2318 | 2200 | $thumbnails = array_values(array_unique($thumbnails)); |
2319 | 2201 | } |
2320 | - } |
|
2321 | - elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'])) |
|
2202 | + } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'])) |
|
2322 | 2203 | { |
2323 | 2204 | foreach ($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['thumbnail'] as $thumbnail) |
2324 | 2205 | { |
@@ -2328,8 +2209,7 @@ discard block |
||
2328 | 2209 | { |
2329 | 2210 | $thumbnails = array_values(array_unique($thumbnails)); |
2330 | 2211 | } |
2331 | - } |
|
2332 | - else |
|
2212 | + } else |
|
2333 | 2213 | { |
2334 | 2214 | $thumbnails = $thumbnails_parent; |
2335 | 2215 | } |
@@ -2338,12 +2218,10 @@ discard block |
||
2338 | 2218 | if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'])) |
2339 | 2219 | { |
2340 | 2220 | $title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
2341 | - } |
|
2342 | - elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'])) |
|
2221 | + } elseif (isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'])) |
|
2343 | 2222 | { |
2344 | 2223 | $title = $this->sanitize($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
2345 | - } |
|
2346 | - else |
|
2224 | + } else |
|
2347 | 2225 | { |
2348 | 2226 | $title = $title_parent; |
2349 | 2227 | } |
@@ -2403,8 +2281,7 @@ discard block |
||
2403 | 2281 | if (isset($content['attribs']['']['duration'])) |
2404 | 2282 | { |
2405 | 2283 | $duration = $this->sanitize($content['attribs']['']['duration'], SIMPLEPIE_CONSTRUCT_TEXT); |
2406 | - } |
|
2407 | - else |
|
2284 | + } else |
|
2408 | 2285 | { |
2409 | 2286 | $duration = $duration_parent; |
2410 | 2287 | } |
@@ -2486,8 +2363,7 @@ discard block |
||
2486 | 2363 | { |
2487 | 2364 | $captions = array_values(array_unique($captions)); |
2488 | 2365 | } |
2489 | - } |
|
2490 | - else |
|
2366 | + } else |
|
2491 | 2367 | { |
2492 | 2368 | $captions = $captions_parent; |
2493 | 2369 | } |
@@ -2507,8 +2383,7 @@ discard block |
||
2507 | 2383 | if (isset($category['attribs']['']['scheme'])) |
2508 | 2384 | { |
2509 | 2385 | $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
2510 | - } |
|
2511 | - else |
|
2386 | + } else |
|
2512 | 2387 | { |
2513 | 2388 | $scheme = 'http://search.yahoo.com/mrss/category_schema'; |
2514 | 2389 | } |
@@ -2522,16 +2397,13 @@ discard block |
||
2522 | 2397 | if (is_array($categories) && is_array($categories_parent)) |
2523 | 2398 | { |
2524 | 2399 | $categories = array_values(array_unique(array_merge($categories, $categories_parent))); |
2525 | - } |
|
2526 | - elseif (is_array($categories)) |
|
2400 | + } elseif (is_array($categories)) |
|
2527 | 2401 | { |
2528 | 2402 | $categories = array_values(array_unique($categories)); |
2529 | - } |
|
2530 | - elseif (is_array($categories_parent)) |
|
2403 | + } elseif (is_array($categories_parent)) |
|
2531 | 2404 | { |
2532 | 2405 | $categories = array_values(array_unique($categories_parent)); |
2533 | - } |
|
2534 | - else |
|
2406 | + } else |
|
2535 | 2407 | { |
2536 | 2408 | $categories = null; |
2537 | 2409 | } |
@@ -2550,8 +2422,7 @@ discard block |
||
2550 | 2422 | $copyright_label = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['copyright'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
2551 | 2423 | } |
2552 | 2424 | $copyrights = $this->registry->create('Copyright', array($copyright_url, $copyright_label)); |
2553 | - } |
|
2554 | - else |
|
2425 | + } else |
|
2555 | 2426 | { |
2556 | 2427 | $copyrights = $copyrights_parent; |
2557 | 2428 | } |
@@ -2571,8 +2442,7 @@ discard block |
||
2571 | 2442 | if (isset($credit['attribs']['']['scheme'])) |
2572 | 2443 | { |
2573 | 2444 | $credit_scheme = $this->sanitize($credit['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
2574 | - } |
|
2575 | - else |
|
2445 | + } else |
|
2576 | 2446 | { |
2577 | 2447 | $credit_scheme = 'urn:ebu'; |
2578 | 2448 | } |
@@ -2586,8 +2456,7 @@ discard block |
||
2586 | 2456 | { |
2587 | 2457 | $credits = array_values(array_unique($credits)); |
2588 | 2458 | } |
2589 | - } |
|
2590 | - else |
|
2459 | + } else |
|
2591 | 2460 | { |
2592 | 2461 | $credits = $credits_parent; |
2593 | 2462 | } |
@@ -2596,8 +2465,7 @@ discard block |
||
2596 | 2465 | if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'])) |
2597 | 2466 | { |
2598 | 2467 | $description = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['description'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
2599 | - } |
|
2600 | - else |
|
2468 | + } else |
|
2601 | 2469 | { |
2602 | 2470 | $description = $description_parent; |
2603 | 2471 | } |
@@ -2616,8 +2484,7 @@ discard block |
||
2616 | 2484 | if (isset($hash['attribs']['']['algo'])) |
2617 | 2485 | { |
2618 | 2486 | $algo = $this->sanitize($hash['attribs']['']['algo'], SIMPLEPIE_CONSTRUCT_TEXT); |
2619 | - } |
|
2620 | - else |
|
2487 | + } else |
|
2621 | 2488 | { |
2622 | 2489 | $algo = 'md5'; |
2623 | 2490 | } |
@@ -2627,8 +2494,7 @@ discard block |
||
2627 | 2494 | { |
2628 | 2495 | $hashes = array_values(array_unique($hashes)); |
2629 | 2496 | } |
2630 | - } |
|
2631 | - else |
|
2497 | + } else |
|
2632 | 2498 | { |
2633 | 2499 | $hashes = $hashes_parent; |
2634 | 2500 | } |
@@ -2649,8 +2515,7 @@ discard block |
||
2649 | 2515 | { |
2650 | 2516 | $keywords = array_values(array_unique($keywords)); |
2651 | 2517 | } |
2652 | - } |
|
2653 | - else |
|
2518 | + } else |
|
2654 | 2519 | { |
2655 | 2520 | $keywords = $keywords_parent; |
2656 | 2521 | } |
@@ -2659,8 +2524,7 @@ discard block |
||
2659 | 2524 | if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'])) |
2660 | 2525 | { |
2661 | 2526 | $player = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['player'][0]['attribs']['']['url'], SIMPLEPIE_CONSTRUCT_IRI); |
2662 | - } |
|
2663 | - else |
|
2527 | + } else |
|
2664 | 2528 | { |
2665 | 2529 | $player = $player_parent; |
2666 | 2530 | } |
@@ -2675,8 +2539,7 @@ discard block |
||
2675 | 2539 | if (isset($rating['attribs']['']['scheme'])) |
2676 | 2540 | { |
2677 | 2541 | $rating_scheme = $this->sanitize($rating['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); |
2678 | - } |
|
2679 | - else |
|
2542 | + } else |
|
2680 | 2543 | { |
2681 | 2544 | $rating_scheme = 'urn:simple'; |
2682 | 2545 | } |
@@ -2690,8 +2553,7 @@ discard block |
||
2690 | 2553 | { |
2691 | 2554 | $ratings = array_values(array_unique($ratings)); |
2692 | 2555 | } |
2693 | - } |
|
2694 | - else |
|
2556 | + } else |
|
2695 | 2557 | { |
2696 | 2558 | $ratings = $ratings_parent; |
2697 | 2559 | } |
@@ -2722,8 +2584,7 @@ discard block |
||
2722 | 2584 | { |
2723 | 2585 | $restrictions = array_values(array_unique($restrictions)); |
2724 | 2586 | } |
2725 | - } |
|
2726 | - else |
|
2587 | + } else |
|
2727 | 2588 | { |
2728 | 2589 | $restrictions = $restrictions_parent; |
2729 | 2590 | } |
@@ -2739,8 +2600,7 @@ discard block |
||
2739 | 2600 | { |
2740 | 2601 | $thumbnails = array_values(array_unique($thumbnails)); |
2741 | 2602 | } |
2742 | - } |
|
2743 | - else |
|
2603 | + } else |
|
2744 | 2604 | { |
2745 | 2605 | $thumbnails = $thumbnails_parent; |
2746 | 2606 | } |
@@ -2749,8 +2609,7 @@ discard block |
||
2749 | 2609 | if (isset($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'])) |
2750 | 2610 | { |
2751 | 2611 | $title = $this->sanitize($content['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['title'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); |
2752 | - } |
|
2753 | - else |
|
2612 | + } else |
|
2754 | 2613 | { |
2755 | 2614 | $title = $title_parent; |
2756 | 2615 | } |
@@ -2876,8 +2735,7 @@ discard block |
||
2876 | 2735 | if (!empty($this->data['enclosures'])) |
2877 | 2736 | { |
2878 | 2737 | return $this->data['enclosures']; |
2879 | - } |
|
2880 | - else |
|
2738 | + } else |
|
2881 | 2739 | { |
2882 | 2740 | return null; |
2883 | 2741 | } |
@@ -2900,12 +2758,10 @@ discard block |
||
2900 | 2758 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat')) |
2901 | 2759 | { |
2902 | 2760 | return (float) $return[0]['data']; |
2903 | - } |
|
2904 | - elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) |
|
2761 | + } elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) |
|
2905 | 2762 | { |
2906 | 2763 | return (float) $match[1]; |
2907 | - } |
|
2908 | - else |
|
2764 | + } else |
|
2909 | 2765 | { |
2910 | 2766 | return null; |
2911 | 2767 | } |
@@ -2928,16 +2784,13 @@ discard block |
||
2928 | 2784 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long')) |
2929 | 2785 | { |
2930 | 2786 | return (float) $return[0]['data']; |
2931 | - } |
|
2932 | - elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon')) |
|
2787 | + } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon')) |
|
2933 | 2788 | { |
2934 | 2789 | return (float) $return[0]['data']; |
2935 | - } |
|
2936 | - elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) |
|
2790 | + } elseif (($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) |
|
2937 | 2791 | { |
2938 | 2792 | return (float) $match[2]; |
2939 | - } |
|
2940 | - else |
|
2793 | + } else |
|
2941 | 2794 | { |
2942 | 2795 | return null; |
2943 | 2796 | } |
@@ -2954,8 +2807,7 @@ discard block |
||
2954 | 2807 | if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'source')) |
2955 | 2808 | { |
2956 | 2809 | return $this->registry->create('Source', array($this, $return[0])); |
2957 | - } |
|
2958 | - else |
|
2810 | + } else |
|
2959 | 2811 | { |
2960 | 2812 | return null; |
2961 | 2813 | } |
@@ -210,6 +210,9 @@ |
||
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
213 | + /** |
|
214 | + * @param string $name |
|
215 | + */ |
|
213 | 216 | protected function search_elements_by_tag($name, &$done, $feeds) |
214 | 217 | { |
215 | 218 | if ($this->dom === null) |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $feeds = array_merge($feeds, $this->search_elements_by_tag('a', $done, $feeds)); |
201 | 201 | $feeds = array_merge($feeds, $this->search_elements_by_tag('area', $done, $feeds)); |
202 | 202 | |
203 | - if (!empty($feeds)) |
|
203 | + if ( ! empty($feeds)) |
|
204 | 204 | { |
205 | 205 | return array_values($feeds); |
206 | 206 | } |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | continue; |
243 | 243 | } |
244 | 244 | |
245 | - if (!in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && !in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call('Misc', 'parse_mime', array($link->getAttribute('type')))), array('application/rss+xml', 'application/atom+xml'))) && !isset($feeds[$href])) |
|
245 | + if ( ! in_array($href, $done) && in_array('feed', $rel) || (in_array('alternate', $rel) && ! in_array('stylesheet', $rel) && $link->hasAttribute('type') && in_array(strtolower($this->registry->call('Misc', 'parse_mime', array($link->getAttribute('type')))), array('application/rss+xml', 'application/atom+xml'))) && ! isset($feeds[$href])) |
|
246 | 246 | { |
247 | 247 | $this->checked_feeds++; |
248 | 248 | $headers = array( |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | } |
306 | 306 | $this->local = array_unique($this->local); |
307 | 307 | $this->elsewhere = array_unique($this->elsewhere); |
308 | - if (!empty($this->local) || !empty($this->elsewhere)) |
|
308 | + if ( ! empty($this->local) || ! empty($this->elsewhere)) |
|
309 | 309 | { |
310 | 310 | return true; |
311 | 311 | } |
@@ -79,8 +79,7 @@ discard block |
||
79 | 79 | set_error_handler(array('SimplePie_Misc', 'silence_errors')); |
80 | 80 | $this->dom->loadHTML($this->file->body); |
81 | 81 | restore_error_handler(); |
82 | - } |
|
83 | - else |
|
82 | + } else |
|
84 | 83 | { |
85 | 84 | $this->dom = null; |
86 | 85 | } |
@@ -151,17 +150,14 @@ discard block |
||
151 | 150 | if (in_array($sniffed, array('application/rss+xml', 'application/rdf+xml', 'text/rdf', 'application/atom+xml', 'text/xml', 'application/xml'))) |
152 | 151 | { |
153 | 152 | return true; |
154 | - } |
|
155 | - else |
|
153 | + } else |
|
156 | 154 | { |
157 | 155 | return false; |
158 | 156 | } |
159 | - } |
|
160 | - elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL) |
|
157 | + } elseif ($file->method & SIMPLEPIE_FILE_SOURCE_LOCAL) |
|
161 | 158 | { |
162 | 159 | return true; |
163 | - } |
|
164 | - else |
|
160 | + } else |
|
165 | 161 | { |
166 | 162 | return false; |
167 | 163 | } |
@@ -203,8 +199,7 @@ discard block |
||
203 | 199 | if (!empty($feeds)) |
204 | 200 | { |
205 | 201 | return array_values($feeds); |
206 | - } |
|
207 | - else |
|
202 | + } else |
|
208 | 203 | { |
209 | 204 | return null; |
210 | 205 | } |
@@ -232,8 +227,7 @@ discard block |
||
232 | 227 | if ($this->base_location < $line) |
233 | 228 | { |
234 | 229 | $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base)); |
235 | - } |
|
236 | - else |
|
230 | + } else |
|
237 | 231 | { |
238 | 232 | $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base)); |
239 | 233 | } |
@@ -280,8 +274,7 @@ discard block |
||
280 | 274 | if (method_exists($link, 'getLineNo') && $this->base_location < $link->getLineNo()) |
281 | 275 | { |
282 | 276 | $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->base)); |
283 | - } |
|
284 | - else |
|
277 | + } else |
|
285 | 278 | { |
286 | 279 | $href = $this->registry->call('Misc', 'absolutize_url', array(trim($link->getAttribute('href')), $this->http_base)); |
287 | 280 | } |
@@ -295,8 +288,7 @@ discard block |
||
295 | 288 | if ($parsed['authority'] === '' || $parsed['authority'] === $current['authority']) |
296 | 289 | { |
297 | 290 | $this->local[] = $href; |
298 | - } |
|
299 | - else |
|
291 | + } else |
|
300 | 292 | { |
301 | 293 | $this->elsewhere[] = $href; |
302 | 294 | } |
@@ -331,8 +323,7 @@ discard block |
||
331 | 323 | if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) |
332 | 324 | { |
333 | 325 | return $feed; |
334 | - } |
|
335 | - else |
|
326 | + } else |
|
336 | 327 | { |
337 | 328 | unset($array[$key]); |
338 | 329 | } |
@@ -359,8 +350,7 @@ discard block |
||
359 | 350 | if ($feed->success && ($feed->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($feed->status_code === 200 || $feed->status_code > 206 && $feed->status_code < 300)) && $this->is_feed($feed)) |
360 | 351 | { |
361 | 352 | return $feed; |
362 | - } |
|
363 | - else |
|
353 | + } else |
|
364 | 354 | { |
365 | 355 | unset($array[$key]); |
366 | 356 | } |
@@ -1,46 +1,46 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * SimplePie |
|
4 | - * |
|
5 | - * A PHP-Based RSS and Atom Feed Framework. |
|
6 | - * Takes the hard work out of managing a complete RSS/Atom solution. |
|
7 | - * |
|
8 | - * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors |
|
9 | - * All rights reserved. |
|
10 | - * |
|
11 | - * Redistribution and use in source and binary forms, with or without modification, are |
|
12 | - * permitted provided that the following conditions are met: |
|
13 | - * |
|
14 | - * * Redistributions of source code must retain the above copyright notice, this list of |
|
15 | - * conditions and the following disclaimer. |
|
16 | - * |
|
17 | - * * Redistributions in binary form must reproduce the above copyright notice, this list |
|
18 | - * of conditions and the following disclaimer in the documentation and/or other materials |
|
19 | - * provided with the distribution. |
|
20 | - * |
|
21 | - * * Neither the name of the SimplePie Team nor the names of its contributors may be used |
|
22 | - * to endorse or promote products derived from this software without specific prior |
|
23 | - * written permission. |
|
24 | - * |
|
25 | - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
|
26 | - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
27 | - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS |
|
28 | - * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
29 | - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
30 | - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
31 | - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
32 | - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
33 | - * POSSIBILITY OF SUCH DAMAGE. |
|
34 | - * |
|
35 | - * @package SimplePie |
|
36 | - * @version 1.3.1 |
|
37 | - * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue |
|
38 | - * @author Ryan Parman |
|
39 | - * @author Geoffrey Sneddon |
|
40 | - * @author Ryan McCue |
|
41 | - * @link http://simplepie.org/ SimplePie |
|
42 | - * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
43 | - */ |
|
3 | + * SimplePie |
|
4 | + * |
|
5 | + * A PHP-Based RSS and Atom Feed Framework. |
|
6 | + * Takes the hard work out of managing a complete RSS/Atom solution. |
|
7 | + * |
|
8 | + * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors |
|
9 | + * All rights reserved. |
|
10 | + * |
|
11 | + * Redistribution and use in source and binary forms, with or without modification, are |
|
12 | + * permitted provided that the following conditions are met: |
|
13 | + * |
|
14 | + * * Redistributions of source code must retain the above copyright notice, this list of |
|
15 | + * conditions and the following disclaimer. |
|
16 | + * |
|
17 | + * * Redistributions in binary form must reproduce the above copyright notice, this list |
|
18 | + * of conditions and the following disclaimer in the documentation and/or other materials |
|
19 | + * provided with the distribution. |
|
20 | + * |
|
21 | + * * Neither the name of the SimplePie Team nor the names of its contributors may be used |
|
22 | + * to endorse or promote products derived from this software without specific prior |
|
23 | + * written permission. |
|
24 | + * |
|
25 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
|
26 | + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
27 | + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS |
|
28 | + * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
29 | + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
30 | + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
31 | + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
32 | + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
33 | + * POSSIBILITY OF SUCH DAMAGE. |
|
34 | + * |
|
35 | + * @package SimplePie |
|
36 | + * @version 1.3.1 |
|
37 | + * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue |
|
38 | + * @author Ryan Parman |
|
39 | + * @author Geoffrey Sneddon |
|
40 | + * @author Ryan McCue |
|
41 | + * @link http://simplepie.org/ SimplePie |
|
42 | + * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
43 | + */ |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Manages all author-related data |
@@ -49,6 +49,9 @@ discard block |
||
49 | 49 | */ |
50 | 50 | class SimplePie_Misc |
51 | 51 | { |
52 | + /** |
|
53 | + * @param integer $seconds |
|
54 | + */ |
|
52 | 55 | public static function time_hms($seconds) |
53 | 56 | { |
54 | 57 | $time = ''; |
@@ -329,6 +332,11 @@ discard block |
||
329 | 332 | } |
330 | 333 | } |
331 | 334 | |
335 | + /** |
|
336 | + * @param string $data |
|
337 | + * @param string $input |
|
338 | + * @param string $output |
|
339 | + */ |
|
332 | 340 | protected static function change_encoding_mbstring($data, $input, $output) |
333 | 341 | { |
334 | 342 | if ($input === 'windows-949') |
@@ -367,6 +375,11 @@ discard block |
||
367 | 375 | return false; |
368 | 376 | } |
369 | 377 | |
378 | + /** |
|
379 | + * @param string $data |
|
380 | + * @param string $input |
|
381 | + * @param string $output |
|
382 | + */ |
|
370 | 383 | protected static function change_encoding_iconv($data, $input, $output) |
371 | 384 | { |
372 | 385 | return @iconv($input, $output, $data); |
@@ -1696,6 +1709,9 @@ discard block |
||
1696 | 1709 | } |
1697 | 1710 | } |
1698 | 1711 | |
1712 | + /** |
|
1713 | + * @return string |
|
1714 | + */ |
|
1699 | 1715 | public static function get_curl_version() |
1700 | 1716 | { |
1701 | 1717 | if (is_array($curl = curl_version())) |
@@ -1763,7 +1779,6 @@ discard block |
||
1763 | 1779 | /** |
1764 | 1780 | * Remove RFC822 comments |
1765 | 1781 | * |
1766 | - * @param string $data Data to strip comments from |
|
1767 | 1782 | * @return string Comment stripped string |
1768 | 1783 | */ |
1769 | 1784 | public static function uncomment_rfc822($string) |
@@ -2019,7 +2034,7 @@ discard block |
||
2019 | 2034 | * @todo Add support for EBCDIC |
2020 | 2035 | * @param string $data XML data |
2021 | 2036 | * @param SimplePie_Registry $registry Class registry |
2022 | - * @return array Possible encodings |
|
2037 | + * @return string[] Possible encodings |
|
2023 | 2038 | */ |
2024 | 2039 | public static function xml_encoding($data, $registry) |
2025 | 2040 | { |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | $seconds = $remainder % 60; |
65 | 65 | if ($minutes < 10 && $hours > 0) |
66 | 66 | { |
67 | - $minutes = '0' . $minutes; |
|
67 | + $minutes = '0'.$minutes; |
|
68 | 68 | } |
69 | 69 | if ($seconds < 10) |
70 | 70 | { |
71 | - $seconds = '0' . $seconds; |
|
71 | + $seconds = '0'.$seconds; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | $time .= $minutes.':'; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | { |
100 | 100 | $return = array(); |
101 | 101 | $name = preg_quote($realname, '/'); |
102 | - if (preg_match_all("/<($name)" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . "(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) |
|
102 | + if (preg_match_all("/<($name)".SIMPLEPIE_PCRE_HTML_ATTRIBUTE."(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) |
|
103 | 103 | { |
104 | 104 | for ($i = 0, $total_matches = count($matches); $i < $total_matches; $i++) |
105 | 105 | { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $return[$i]['content'] = $matches[$i][4][0]; |
117 | 117 | } |
118 | 118 | $return[$i]['attribs'] = array(); |
119 | - if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER)) |
|
119 | + if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' '.$matches[$i][2][0].' ', $attribs, PREG_SET_ORDER)) |
|
120 | 120 | { |
121 | 121 | for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++) |
122 | 122 | { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | foreach ($element['attribs'] as $key => $value) |
139 | 139 | { |
140 | 140 | $key = strtolower($key); |
141 | - $full .= " $key=\"" . htmlspecialchars($value['data']) . '"'; |
|
141 | + $full .= " $key=\"".htmlspecialchars($value['data']).'"'; |
|
142 | 142 | } |
143 | 143 | if ($element['self_closing']) |
144 | 144 | { |
@@ -172,13 +172,13 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | $log_error = true; |
175 | - if (!function_exists('error_log')) |
|
175 | + if ( ! function_exists('error_log')) |
|
176 | 176 | { |
177 | 177 | $log_error = false; |
178 | 178 | } |
179 | 179 | |
180 | 180 | $log_file = @ini_get('error_log'); |
181 | - if (!empty($log_file) && ('syslog' !== $log_file) && !@is_writable($log_file)) |
|
181 | + if ( ! empty($log_file) && ('syslog' !== $log_file) && ! @is_writable($log_file)) |
|
182 | 182 | { |
183 | 183 | $log_error = false; |
184 | 184 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['authority'], $parsed['path'], $parsed['query'], $parsed['fragment']), $http); |
202 | 202 | } |
203 | 203 | |
204 | - if ($parsed['scheme'] === '' && $parsed['authority'] === '' && !file_exists($url)) |
|
204 | + if ($parsed['scheme'] === '' && $parsed['authority'] === '' && ! file_exists($url)) |
|
205 | 205 | { |
206 | 206 | return SimplePie_Misc::fix_protocol(SimplePie_Misc::compress_parse_url('http', $parsed['path'], '', $parsed['query'], $parsed['fragment']), $http); |
207 | 207 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | if ($input === 'US-ASCII') |
298 | 298 | { |
299 | 299 | static $non_ascii_octects = ''; |
300 | - if (!$non_ascii_octects) |
|
300 | + if ( ! $non_ascii_octects) |
|
301 | 301 | { |
302 | 302 | for ($i = 0x80; $i <= 0xFF; $i++) |
303 | 303 | { |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | { |
354 | 354 | return false; |
355 | 355 | } |
356 | - if (!in_array($input, mb_list_encodings())) |
|
356 | + if ( ! in_array($input, mb_list_encodings())) |
|
357 | 357 | { |
358 | 358 | return false; |
359 | 359 | } |
@@ -1738,7 +1738,7 @@ discard block |
||
1738 | 1738 | $data = ''; |
1739 | 1739 | } |
1740 | 1740 | } |
1741 | - return $output . $data; |
|
1741 | + return $output.$data; |
|
1742 | 1742 | } |
1743 | 1743 | |
1744 | 1744 | public static function parse_date($dt) |
@@ -1965,15 +1965,15 @@ discard block |
||
1965 | 1965 | } |
1966 | 1966 | else if ($codepoint <= 0x7ff) |
1967 | 1967 | { |
1968 | - return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f)); |
|
1968 | + return chr(0xc0 | ($codepoint >> 6)).chr(0x80 | ($codepoint & 0x3f)); |
|
1969 | 1969 | } |
1970 | 1970 | else if ($codepoint <= 0xffff) |
1971 | 1971 | { |
1972 | - return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); |
|
1972 | + return chr(0xe0 | ($codepoint >> 12)).chr(0x80 | (($codepoint >> 6) & 0x3f)).chr(0x80 | ($codepoint & 0x3f)); |
|
1973 | 1973 | } |
1974 | 1974 | else if ($codepoint <= 0x10ffff) |
1975 | 1975 | { |
1976 | - return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); |
|
1976 | + return chr(0xf0 | ($codepoint >> 18)).chr(0x80 | (($codepoint >> 12) & 0x3f)).chr(0x80 | (($codepoint >> 6) & 0x3f)).chr(0x80 | ($codepoint & 0x3f)); |
|
1977 | 1977 | } |
1978 | 1978 | else |
1979 | 1979 | { |
@@ -2129,7 +2129,7 @@ discard block |
||
2129 | 2129 | } |
2130 | 2130 | header('Content-type: text/javascript; charset: UTF-8'); |
2131 | 2131 | header('Cache-Control: must-revalidate'); |
2132 | - header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days |
|
2132 | + header('Expires: '.gmdate('D, d M Y H:i:s', time() + 604800).' GMT'); // 7 days |
|
2133 | 2133 | ?> |
2134 | 2134 | function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) { |
2135 | 2135 | if (placeholder != '') { |
@@ -2163,14 +2163,14 @@ discard block |
||
2163 | 2163 | public static function get_build() |
2164 | 2164 | { |
2165 | 2165 | $root = dirname(dirname(__FILE__)); |
2166 | - if (file_exists($root . '/.git/index')) |
|
2166 | + if (file_exists($root.'/.git/index')) |
|
2167 | 2167 | { |
2168 | - return filemtime($root . '/.git/index'); |
|
2168 | + return filemtime($root.'/.git/index'); |
|
2169 | 2169 | } |
2170 | - elseif (file_exists($root . '/SimplePie')) |
|
2170 | + elseif (file_exists($root.'/SimplePie')) |
|
2171 | 2171 | { |
2172 | 2172 | $time = 0; |
2173 | - foreach (glob($root . '/SimplePie/*.php') as $file) |
|
2173 | + foreach (glob($root.'/SimplePie/*.php') as $file) |
|
2174 | 2174 | { |
2175 | 2175 | if (($mtime = filemtime($file)) > $time) |
2176 | 2176 | { |
@@ -2179,9 +2179,9 @@ discard block |
||
2179 | 2179 | } |
2180 | 2180 | return $time; |
2181 | 2181 | } |
2182 | - elseif (file_exists(dirname(__FILE__) . '/Core.php')) |
|
2182 | + elseif (file_exists(dirname(__FILE__).'/Core.php')) |
|
2183 | 2183 | { |
2184 | - return filemtime(dirname(__FILE__) . '/Core.php'); |
|
2184 | + return filemtime(dirname(__FILE__).'/Core.php'); |
|
2185 | 2185 | } |
2186 | 2186 | else |
2187 | 2187 | { |
@@ -2194,11 +2194,11 @@ discard block |
||
2194 | 2194 | */ |
2195 | 2195 | public static function debug(&$sp) |
2196 | 2196 | { |
2197 | - $info = 'SimplePie ' . SIMPLEPIE_VERSION . ' Build ' . SIMPLEPIE_BUILD . "\n"; |
|
2198 | - $info .= 'PHP ' . PHP_VERSION . "\n"; |
|
2197 | + $info = 'SimplePie '.SIMPLEPIE_VERSION.' Build '.SIMPLEPIE_BUILD."\n"; |
|
2198 | + $info .= 'PHP '.PHP_VERSION."\n"; |
|
2199 | 2199 | if ($sp->error() !== null) |
2200 | 2200 | { |
2201 | - $info .= 'Error occurred: ' . $sp->error() . "\n"; |
|
2201 | + $info .= 'Error occurred: '.$sp->error()."\n"; |
|
2202 | 2202 | } |
2203 | 2203 | else |
2204 | 2204 | { |
@@ -2214,20 +2214,20 @@ discard block |
||
2214 | 2214 | switch ($ext) |
2215 | 2215 | { |
2216 | 2216 | case 'pcre': |
2217 | - $info .= ' Version ' . PCRE_VERSION . "\n"; |
|
2217 | + $info .= ' Version '.PCRE_VERSION."\n"; |
|
2218 | 2218 | break; |
2219 | 2219 | case 'curl': |
2220 | 2220 | $version = curl_version(); |
2221 | - $info .= ' Version ' . $version['version'] . "\n"; |
|
2221 | + $info .= ' Version '.$version['version']."\n"; |
|
2222 | 2222 | break; |
2223 | 2223 | case 'mbstring': |
2224 | - $info .= ' Overloading: ' . mb_get_info('func_overload') . "\n"; |
|
2224 | + $info .= ' Overloading: '.mb_get_info('func_overload')."\n"; |
|
2225 | 2225 | break; |
2226 | 2226 | case 'iconv': |
2227 | - $info .= ' Version ' . ICONV_VERSION . "\n"; |
|
2227 | + $info .= ' Version '.ICONV_VERSION."\n"; |
|
2228 | 2228 | break; |
2229 | 2229 | case 'xml': |
2230 | - $info .= ' Version ' . LIBXML_DOTTED_VERSION . "\n"; |
|
2230 | + $info .= ' Version '.LIBXML_DOTTED_VERSION."\n"; |
|
2231 | 2231 | break; |
2232 | 2232 | } |
2233 | 2233 | } |
@@ -109,8 +109,7 @@ discard block |
||
109 | 109 | if (strlen($matches[$i][3][0]) <= 2) |
110 | 110 | { |
111 | 111 | $return[$i]['self_closing'] = true; |
112 | - } |
|
113 | - else |
|
112 | + } else |
|
114 | 113 | { |
115 | 114 | $return[$i]['self_closing'] = false; |
116 | 115 | $return[$i]['content'] = $matches[$i][4][0]; |
@@ -143,8 +142,7 @@ discard block |
||
143 | 142 | if ($element['self_closing']) |
144 | 143 | { |
145 | 144 | $full .= ' />'; |
146 | - } |
|
147 | - else |
|
145 | + } else |
|
148 | 146 | { |
149 | 147 | $full .= ">$element[content]</$element[tag]>"; |
150 | 148 | } |
@@ -209,16 +207,13 @@ discard block |
||
209 | 207 | if ($http === 2 && $parsed['scheme'] !== '') |
210 | 208 | { |
211 | 209 | return "feed:$url"; |
212 | - } |
|
213 | - elseif ($http === 3 && strtolower($parsed['scheme']) === 'http') |
|
210 | + } elseif ($http === 3 && strtolower($parsed['scheme']) === 'http') |
|
214 | 211 | { |
215 | 212 | return substr_replace($url, 'podcast', 0, 4); |
216 | - } |
|
217 | - elseif ($http === 4 && strtolower($parsed['scheme']) === 'http') |
|
213 | + } elseif ($http === 4 && strtolower($parsed['scheme']) === 'http') |
|
218 | 214 | { |
219 | 215 | return substr_replace($url, 'itpc', 0, 4); |
220 | - } |
|
221 | - else |
|
216 | + } else |
|
222 | 217 | { |
223 | 218 | return $url; |
224 | 219 | } |
@@ -259,8 +254,7 @@ discard block |
||
259 | 254 | if ($integer >= 0x41 && $integer <= 0x5A || $integer >= 0x61 && $integer <= 0x7A || $integer >= 0x30 && $integer <= 0x39 || $integer === 0x2D || $integer === 0x2E || $integer === 0x5F || $integer === 0x7E) |
260 | 255 | { |
261 | 256 | return chr($integer); |
262 | - } |
|
263 | - else |
|
257 | + } else |
|
264 | 258 | { |
265 | 259 | return strtoupper($match[0]); |
266 | 260 | } |
@@ -1701,16 +1695,13 @@ discard block |
||
1701 | 1695 | if (is_array($curl = curl_version())) |
1702 | 1696 | { |
1703 | 1697 | $curl = $curl['version']; |
1704 | - } |
|
1705 | - elseif (substr($curl, 0, 5) === 'curl/') |
|
1698 | + } elseif (substr($curl, 0, 5) === 'curl/') |
|
1706 | 1699 | { |
1707 | 1700 | $curl = substr($curl, 5, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 5)); |
1708 | - } |
|
1709 | - elseif (substr($curl, 0, 8) === 'libcurl/') |
|
1701 | + } elseif (substr($curl, 0, 8) === 'libcurl/') |
|
1710 | 1702 | { |
1711 | 1703 | $curl = substr($curl, 8, strcspn($curl, "\x09\x0A\x0B\x0C\x0D", 8)); |
1712 | - } |
|
1713 | - else |
|
1704 | + } else |
|
1714 | 1705 | { |
1715 | 1706 | $curl = 0; |
1716 | 1707 | } |
@@ -1732,8 +1723,7 @@ discard block |
||
1732 | 1723 | if (($end = strpos($data, '-->', $start)) !== false) |
1733 | 1724 | { |
1734 | 1725 | $data = substr_replace($data, '', 0, $end + 3); |
1735 | - } |
|
1736 | - else |
|
1726 | + } else |
|
1737 | 1727 | { |
1738 | 1728 | $data = ''; |
1739 | 1729 | } |
@@ -1789,8 +1779,7 @@ discard block |
||
1789 | 1779 | { |
1790 | 1780 | $position++; |
1791 | 1781 | continue; |
1792 | - } |
|
1793 | - elseif (isset($string[$position])) |
|
1782 | + } elseif (isset($string[$position])) |
|
1794 | 1783 | { |
1795 | 1784 | switch ($string[$position]) |
1796 | 1785 | { |
@@ -1803,14 +1792,12 @@ discard block |
||
1803 | 1792 | break; |
1804 | 1793 | } |
1805 | 1794 | $position++; |
1806 | - } |
|
1807 | - else |
|
1795 | + } else |
|
1808 | 1796 | { |
1809 | 1797 | break; |
1810 | 1798 | } |
1811 | 1799 | } |
1812 | - } |
|
1813 | - else |
|
1800 | + } else |
|
1814 | 1801 | { |
1815 | 1802 | $output .= '('; |
1816 | 1803 | } |
@@ -1825,8 +1812,7 @@ discard block |
||
1825 | 1812 | if (($pos = strpos($mime, ';')) === false) |
1826 | 1813 | { |
1827 | 1814 | return trim($mime); |
1828 | - } |
|
1829 | - else |
|
1815 | + } else |
|
1830 | 1816 | { |
1831 | 1817 | return trim(substr($mime, 0, $pos)); |
1832 | 1818 | } |
@@ -1837,8 +1823,7 @@ discard block |
||
1837 | 1823 | if (isset($attribs['']['mode']) && strtolower(trim($attribs['']['mode']) === 'base64')) |
1838 | 1824 | { |
1839 | 1825 | $mode = SIMPLEPIE_CONSTRUCT_BASE64; |
1840 | - } |
|
1841 | - else |
|
1826 | + } else |
|
1842 | 1827 | { |
1843 | 1828 | $mode = SIMPLEPIE_CONSTRUCT_NONE; |
1844 | 1829 | } |
@@ -1861,8 +1846,7 @@ discard block |
||
1861 | 1846 | default: |
1862 | 1847 | return SIMPLEPIE_CONSTRUCT_NONE | $mode; |
1863 | 1848 | } |
1864 | - } |
|
1865 | - else |
|
1849 | + } else |
|
1866 | 1850 | { |
1867 | 1851 | return SIMPLEPIE_CONSTRUCT_TEXT | $mode; |
1868 | 1852 | } |
@@ -1909,13 +1893,11 @@ discard block |
||
1909 | 1893 | if (in_array(substr($type, -4), array('+xml', '/xml')) || substr($type, 0, 5) === 'text/') |
1910 | 1894 | { |
1911 | 1895 | return SIMPLEPIE_CONSTRUCT_NONE; |
1912 | - } |
|
1913 | - else |
|
1896 | + } else |
|
1914 | 1897 | { |
1915 | 1898 | return SIMPLEPIE_CONSTRUCT_BASE64; |
1916 | 1899 | } |
1917 | - } |
|
1918 | - else |
|
1900 | + } else |
|
1919 | 1901 | { |
1920 | 1902 | return SIMPLEPIE_CONSTRUCT_TEXT; |
1921 | 1903 | } |
@@ -1958,24 +1940,19 @@ discard block |
||
1958 | 1940 | if ($codepoint < 0) |
1959 | 1941 | { |
1960 | 1942 | return false; |
1961 | - } |
|
1962 | - else if ($codepoint <= 0x7f) |
|
1943 | + } else if ($codepoint <= 0x7f) |
|
1963 | 1944 | { |
1964 | 1945 | return chr($codepoint); |
1965 | - } |
|
1966 | - else if ($codepoint <= 0x7ff) |
|
1946 | + } else if ($codepoint <= 0x7ff) |
|
1967 | 1947 | { |
1968 | 1948 | return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f)); |
1969 | - } |
|
1970 | - else if ($codepoint <= 0xffff) |
|
1949 | + } else if ($codepoint <= 0xffff) |
|
1971 | 1950 | { |
1972 | 1951 | return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); |
1973 | - } |
|
1974 | - else if ($codepoint <= 0x10ffff) |
|
1952 | + } else if ($codepoint <= 0x10ffff) |
|
1975 | 1953 | { |
1976 | 1954 | return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f)); |
1977 | - } |
|
1978 | - else |
|
1955 | + } else |
|
1979 | 1956 | { |
1980 | 1957 | // U+FFFD REPLACEMENT CHARACTER |
1981 | 1958 | return "\xEF\xBF\xBD"; |
@@ -2003,8 +1980,7 @@ discard block |
||
2003 | 1980 | { |
2004 | 1981 | list($name, $value) = explode('=', $section, 2); |
2005 | 1982 | $return[urldecode($name)][] = urldecode($value); |
2006 | - } |
|
2007 | - else |
|
1983 | + } else |
|
2008 | 1984 | { |
2009 | 1985 | $return[urldecode($section)][] = null; |
2010 | 1986 | } |
@@ -2166,8 +2142,7 @@ discard block |
||
2166 | 2142 | if (file_exists($root . '/.git/index')) |
2167 | 2143 | { |
2168 | 2144 | return filemtime($root . '/.git/index'); |
2169 | - } |
|
2170 | - elseif (file_exists($root . '/SimplePie')) |
|
2145 | + } elseif (file_exists($root . '/SimplePie')) |
|
2171 | 2146 | { |
2172 | 2147 | $time = 0; |
2173 | 2148 | foreach (glob($root . '/SimplePie/*.php') as $file) |
@@ -2178,12 +2153,10 @@ discard block |
||
2178 | 2153 | } |
2179 | 2154 | } |
2180 | 2155 | return $time; |
2181 | - } |
|
2182 | - elseif (file_exists(dirname(__FILE__) . '/Core.php')) |
|
2156 | + } elseif (file_exists(dirname(__FILE__) . '/Core.php')) |
|
2183 | 2157 | { |
2184 | 2158 | return filemtime(dirname(__FILE__) . '/Core.php'); |
2185 | - } |
|
2186 | - else |
|
2159 | + } else |
|
2187 | 2160 | { |
2188 | 2161 | return filemtime(__FILE__); |
2189 | 2162 | } |
@@ -2199,8 +2172,7 @@ discard block |
||
2199 | 2172 | if ($sp->error() !== null) |
2200 | 2173 | { |
2201 | 2174 | $info .= 'Error occurred: ' . $sp->error() . "\n"; |
2202 | - } |
|
2203 | - else |
|
2175 | + } else |
|
2204 | 2176 | { |
2205 | 2177 | $info .= "No error found.\n"; |
2206 | 2178 | } |
@@ -2230,8 +2202,7 @@ discard block |
||
2230 | 2202 | $info .= ' Version ' . LIBXML_DOTTED_VERSION . "\n"; |
2231 | 2203 | break; |
2232 | 2204 | } |
2233 | - } |
|
2234 | - else |
|
2205 | + } else |
|
2235 | 2206 | { |
2236 | 2207 | $info .= " $ext not loaded\n"; |
2237 | 2208 | } |
@@ -190,7 +190,7 @@ |
||
190 | 190 | * 0:0:0:0:0:FFFF:129.144.52.38 |
191 | 191 | * |
192 | 192 | * @param string $ip An IPv6 address |
193 | - * @return array [0] contains the IPv6 represented part, and [1] the IPv4 represented part |
|
193 | + * @return string[] [0] contains the IPv6 represented part, and [1] the IPv4 represented part |
|
194 | 194 | */ |
195 | 195 | private static function split_v6_v4($ip) |
196 | 196 | { |
@@ -123,7 +123,7 @@ |
||
123 | 123 | // xxx::xxx |
124 | 124 | else |
125 | 125 | { |
126 | - $fill = ':' . str_repeat('0:', 6 - $c2 - $c1); |
|
126 | + $fill = ':'.str_repeat('0:', 6 - $c2 - $c1); |
|
127 | 127 | $ip = str_replace('::', $fill, $ip); |
128 | 128 | } |
129 | 129 | } |
@@ -86,16 +86,14 @@ discard block |
||
86 | 86 | if ($ip1 === '') |
87 | 87 | { |
88 | 88 | $c1 = -1; |
89 | - } |
|
90 | - else |
|
89 | + } else |
|
91 | 90 | { |
92 | 91 | $c1 = substr_count($ip1, ':'); |
93 | 92 | } |
94 | 93 | if ($ip2 === '') |
95 | 94 | { |
96 | 95 | $c2 = -1; |
97 | - } |
|
98 | - else |
|
96 | + } else |
|
99 | 97 | { |
100 | 98 | $c2 = substr_count($ip2, ':'); |
101 | 99 | } |
@@ -173,8 +171,7 @@ discard block |
||
173 | 171 | if ($ip_parts[1] !== '') |
174 | 172 | { |
175 | 173 | return implode(':', $ip_parts); |
176 | - } |
|
177 | - else |
|
174 | + } else |
|
178 | 175 | { |
179 | 176 | return $ip_parts[0]; |
180 | 177 | } |
@@ -200,8 +197,7 @@ discard block |
||
200 | 197 | $ipv6_part = substr($ip, 0, $pos); |
201 | 198 | $ipv4_part = substr($ip, $pos + 1); |
202 | 199 | return array($ipv6_part, $ipv4_part); |
203 | - } |
|
204 | - else |
|
200 | + } else |
|
205 | 201 | { |
206 | 202 | return array($ip, ''); |
207 | 203 | } |
@@ -226,35 +222,39 @@ discard block |
||
226 | 222 | foreach ($ipv6 as $ipv6_part) |
227 | 223 | { |
228 | 224 | // The section can't be empty |
229 | - if ($ipv6_part === '') |
|
230 | - return false; |
|
225 | + if ($ipv6_part === '') { |
|
226 | + return false; |
|
227 | + } |
|
231 | 228 | |
232 | 229 | // Nor can it be over four characters |
233 | - if (strlen($ipv6_part) > 4) |
|
234 | - return false; |
|
230 | + if (strlen($ipv6_part) > 4) { |
|
231 | + return false; |
|
232 | + } |
|
235 | 233 | |
236 | 234 | // Remove leading zeros (this is safe because of the above) |
237 | 235 | $ipv6_part = ltrim($ipv6_part, '0'); |
238 | - if ($ipv6_part === '') |
|
239 | - $ipv6_part = '0'; |
|
236 | + if ($ipv6_part === '') { |
|
237 | + $ipv6_part = '0'; |
|
238 | + } |
|
240 | 239 | |
241 | 240 | // Check the value is valid |
242 | 241 | $value = hexdec($ipv6_part); |
243 | - if (dechex($value) !== strtolower($ipv6_part) || $value < 0 || $value > 0xFFFF) |
|
244 | - return false; |
|
242 | + if (dechex($value) !== strtolower($ipv6_part) || $value < 0 || $value > 0xFFFF) { |
|
243 | + return false; |
|
244 | + } |
|
245 | 245 | } |
246 | 246 | if (count($ipv4) === 4) |
247 | 247 | { |
248 | 248 | foreach ($ipv4 as $ipv4_part) |
249 | 249 | { |
250 | 250 | $value = (int) $ipv4_part; |
251 | - if ((string) $value !== $ipv4_part || $value < 0 || $value > 0xFF) |
|
252 | - return false; |
|
251 | + if ((string) $value !== $ipv4_part || $value < 0 || $value > 0xFF) { |
|
252 | + return false; |
|
253 | + } |
|
253 | 254 | } |
254 | 255 | } |
255 | 256 | return true; |
256 | - } |
|
257 | - else |
|
257 | + } else |
|
258 | 258 | { |
259 | 259 | return false; |
260 | 260 | } |
@@ -704,7 +704,6 @@ |
||
704 | 704 | * Remove RFC822 comments |
705 | 705 | * |
706 | 706 | * @access protected |
707 | - * @param string $data Data to strip comments from |
|
708 | 707 | * @return string Comment stripped string |
709 | 708 | */ |
710 | 709 | public function remove_rfc2822_comments($string) |
@@ -541,11 +541,11 @@ discard block |
||
541 | 541 | */ |
542 | 542 | public function __construct() |
543 | 543 | { |
544 | - $this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')'; |
|
545 | - $this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')'; |
|
544 | + $this->day_pcre = '('.implode(array_keys($this->day), '|').')'; |
|
545 | + $this->month_pcre = '('.implode(array_keys($this->month), '|').')'; |
|
546 | 546 | |
547 | 547 | static $cache; |
548 | - if (!isset($cache[get_class($this)])) |
|
548 | + if ( ! isset($cache[get_class($this)])) |
|
549 | 549 | { |
550 | 550 | $all_methods = get_class_methods($this); |
551 | 551 | |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | public static function get() |
573 | 573 | { |
574 | 574 | static $object; |
575 | - if (!$object) |
|
575 | + if ( ! $object) |
|
576 | 576 | { |
577 | 577 | $object = new SimplePie_Parse_Date; |
578 | 578 | } |
@@ -638,13 +638,13 @@ discard block |
||
638 | 638 | public function date_w3cdtf($date) |
639 | 639 | { |
640 | 640 | static $pcre; |
641 | - if (!$pcre) |
|
641 | + if ( ! $pcre) |
|
642 | 642 | { |
643 | 643 | $year = '([0-9]{4})'; |
644 | 644 | $month = $day = $hour = $minute = $second = '([0-9]{2})'; |
645 | 645 | $decimal = '([0-9]*)'; |
646 | 646 | $zone = '(?:(Z)|([+\-])([0-9]{1,2}):?([0-9]{1,2}))'; |
647 | - $pcre = '/^' . $year . '(?:-?' . $month . '(?:-?' . $day . '(?:[Tt\x09\x20]+' . $hour . '(?::?' . $minute . '(?::?' . $second . '(?:.' . $decimal . ')?)?)?' . $zone . ')?)?)?$/'; |
|
647 | + $pcre = '/^'.$year.'(?:-?'.$month.'(?:-?'.$day.'(?:[Tt\x09\x20]+'.$hour.'(?::?'.$minute.'(?::?'.$second.'(?:.'.$decimal.')?)?)?'.$zone.')?)?)?$/'; |
|
648 | 648 | } |
649 | 649 | if (preg_match($pcre, $date, $match)) |
650 | 650 | { |
@@ -770,11 +770,11 @@ discard block |
||
770 | 770 | public function date_rfc2822($date) |
771 | 771 | { |
772 | 772 | static $pcre; |
773 | - if (!$pcre) |
|
773 | + if ( ! $pcre) |
|
774 | 774 | { |
775 | 775 | $wsp = '[\x09\x20]'; |
776 | - $fws = '(?:' . $wsp . '+|' . $wsp . '*(?:\x0D\x0A' . $wsp . '+)+)'; |
|
777 | - $optional_fws = $fws . '?'; |
|
776 | + $fws = '(?:'.$wsp.'+|'.$wsp.'*(?:\x0D\x0A'.$wsp.'+)+)'; |
|
777 | + $optional_fws = $fws.'?'; |
|
778 | 778 | $day_name = $this->day_pcre; |
779 | 779 | $month = $this->month_pcre; |
780 | 780 | $day = '([0-9]{1,2})'; |
@@ -782,8 +782,8 @@ discard block |
||
782 | 782 | $year = '([0-9]{2,4})'; |
783 | 783 | $num_zone = '([+\-])([0-9]{2})([0-9]{2})'; |
784 | 784 | $character_zone = '([A-Z]{1,5})'; |
785 | - $zone = '(?:' . $num_zone . '|' . $character_zone . ')'; |
|
786 | - $pcre = '/(?:' . $optional_fws . $day_name . $optional_fws . ',)?' . $optional_fws . $day . $fws . $month . $fws . $year . $fws . $hour . $optional_fws . ':' . $optional_fws . $minute . '(?:' . $optional_fws . ':' . $optional_fws . $second . ')?' . $fws . $zone . '/i'; |
|
785 | + $zone = '(?:'.$num_zone.'|'.$character_zone.')'; |
|
786 | + $pcre = '/(?:'.$optional_fws.$day_name.$optional_fws.',)?'.$optional_fws.$day.$fws.$month.$fws.$year.$fws.$hour.$optional_fws.':'.$optional_fws.$minute.'(?:'.$optional_fws.':'.$optional_fws.$second.')?'.$fws.$zone.'/i'; |
|
787 | 787 | } |
788 | 788 | if (preg_match($pcre, $this->remove_rfc2822_comments($date), $match)) |
789 | 789 | { |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | public function date_rfc850($date) |
864 | 864 | { |
865 | 865 | static $pcre; |
866 | - if (!$pcre) |
|
866 | + if ( ! $pcre) |
|
867 | 867 | { |
868 | 868 | $space = '[\x09\x20]+'; |
869 | 869 | $day_name = $this->day_pcre; |
@@ -871,7 +871,7 @@ discard block |
||
871 | 871 | $day = '([0-9]{1,2})'; |
872 | 872 | $year = $hour = $minute = $second = '([0-9]{2})'; |
873 | 873 | $zone = '([A-Z]{1,5})'; |
874 | - $pcre = '/^' . $day_name . ',' . $space . $day . '-' . $month . '-' . $year . $space . $hour . ':' . $minute . ':' . $second . $space . $zone . '$/i'; |
|
874 | + $pcre = '/^'.$day_name.','.$space.$day.'-'.$month.'-'.$year.$space.$hour.':'.$minute.':'.$second.$space.$zone.'$/i'; |
|
875 | 875 | } |
876 | 876 | if (preg_match($pcre, $date, $match)) |
877 | 877 | { |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | public function date_asctime($date) |
929 | 929 | { |
930 | 930 | static $pcre; |
931 | - if (!$pcre) |
|
931 | + if ( ! $pcre) |
|
932 | 932 | { |
933 | 933 | $space = '[\x09\x20]+'; |
934 | 934 | $wday_name = $this->day_pcre; |
@@ -937,7 +937,7 @@ discard block |
||
937 | 937 | $hour = $sec = $min = '([0-9]{2})'; |
938 | 938 | $year = '([0-9]{4})'; |
939 | 939 | $terminator = '\x0A?\x00?'; |
940 | - $pcre = '/^' . $wday_name . $space . $mon_name . $space . $day . $space . $hour . ':' . $min . ':' . $sec . $space . $year . $terminator . '$/i'; |
|
940 | + $pcre = '/^'.$wday_name.$space.$mon_name.$space.$day.$space.$hour.':'.$min.':'.$sec.$space.$year.$terminator.'$/i'; |
|
941 | 941 | } |
942 | 942 | if (preg_match($pcre, $date, $match)) |
943 | 943 | { |
@@ -620,8 +620,7 @@ discard block |
||
620 | 620 | if (is_callable($callback)) |
621 | 621 | { |
622 | 622 | $this->user[] = $callback; |
623 | - } |
|
624 | - else |
|
623 | + } else |
|
625 | 624 | { |
626 | 625 | trigger_error('User-supplied function must be a valid callback', E_USER_WARNING); |
627 | 626 | } |
@@ -683,8 +682,7 @@ discard block |
||
683 | 682 | { |
684 | 683 | $timezone = 0 - $timezone; |
685 | 684 | } |
686 | - } |
|
687 | - else |
|
685 | + } else |
|
688 | 686 | { |
689 | 687 | $timezone = 0; |
690 | 688 | } |
@@ -693,8 +691,7 @@ discard block |
||
693 | 691 | $second = round($match[6] + $match[7] / pow(10, strlen($match[7]))); |
694 | 692 | |
695 | 693 | return gmmktime($match[4], $match[5], $second, $match[2], $match[3], $match[1]) - $timezone; |
696 | - } |
|
697 | - else |
|
694 | + } else |
|
698 | 695 | { |
699 | 696 | return false; |
700 | 697 | } |
@@ -730,8 +727,7 @@ discard block |
||
730 | 727 | { |
731 | 728 | $position++; |
732 | 729 | continue; |
733 | - } |
|
734 | - elseif (isset($string[$position])) |
|
730 | + } elseif (isset($string[$position])) |
|
735 | 731 | { |
736 | 732 | switch ($string[$position]) |
737 | 733 | { |
@@ -744,14 +740,12 @@ discard block |
||
744 | 740 | break; |
745 | 741 | } |
746 | 742 | $position++; |
747 | - } |
|
748 | - else |
|
743 | + } else |
|
749 | 744 | { |
750 | 745 | break; |
751 | 746 | } |
752 | 747 | } |
753 | - } |
|
754 | - else |
|
748 | + } else |
|
755 | 749 | { |
756 | 750 | $output .= '('; |
757 | 751 | } |
@@ -830,8 +824,7 @@ discard block |
||
830 | 824 | if ($match[4] < 50) |
831 | 825 | { |
832 | 826 | $match[4] += 2000; |
833 | - } |
|
834 | - elseif ($match[4] < 1000) |
|
827 | + } elseif ($match[4] < 1000) |
|
835 | 828 | { |
836 | 829 | $match[4] += 1900; |
837 | 830 | } |
@@ -840,15 +833,13 @@ discard block |
||
840 | 833 | if ($match[7] !== '') |
841 | 834 | { |
842 | 835 | $second = $match[7]; |
843 | - } |
|
844 | - else |
|
836 | + } else |
|
845 | 837 | { |
846 | 838 | $second = 0; |
847 | 839 | } |
848 | 840 | |
849 | 841 | return gmmktime($match[5], $match[6], $second, $month, $match[2], $match[4]) - $timezone; |
850 | - } |
|
851 | - else |
|
842 | + } else |
|
852 | 843 | { |
853 | 844 | return false; |
854 | 845 | } |
@@ -905,15 +896,13 @@ discard block |
||
905 | 896 | if ($match[4] < 50) |
906 | 897 | { |
907 | 898 | $match[4] += 2000; |
908 | - } |
|
909 | - else |
|
899 | + } else |
|
910 | 900 | { |
911 | 901 | $match[4] += 1900; |
912 | 902 | } |
913 | 903 | |
914 | 904 | return gmmktime($match[5], $match[6], $match[7], $month, $match[2], $match[4]) - $timezone; |
915 | - } |
|
916 | - else |
|
905 | + } else |
|
917 | 906 | { |
918 | 907 | return false; |
919 | 908 | } |
@@ -954,8 +943,7 @@ discard block |
||
954 | 943 | |
955 | 944 | $month = $this->month[strtolower($match[2])]; |
956 | 945 | return gmmktime($match[4], $match[5], $match[6], $month, $match[3], $match[7]); |
957 | - } |
|
958 | - else |
|
946 | + } else |
|
959 | 947 | { |
960 | 948 | return false; |
961 | 949 | } |
@@ -973,8 +961,7 @@ discard block |
||
973 | 961 | if ($strtotime === -1 || $strtotime === false) |
974 | 962 | { |
975 | 963 | return false; |
976 | - } |
|
977 | - else |
|
964 | + } else |
|
978 | 965 | { |
979 | 966 | return $strtotime; |
980 | 967 | } |
@@ -265,6 +265,9 @@ discard block |
||
265 | 265 | return $this->data; |
266 | 266 | } |
267 | 267 | |
268 | + /** |
|
269 | + * @param string $tag |
|
270 | + */ |
|
268 | 271 | public function tag_open($parser, $tag, $attributes) |
269 | 272 | { |
270 | 273 | list($this->namespace[], $this->element[]) = $this->split_ns($tag); |
@@ -332,6 +335,9 @@ discard block |
||
332 | 335 | } |
333 | 336 | } |
334 | 337 | |
338 | + /** |
|
339 | + * @param string $cdata |
|
340 | + */ |
|
335 | 341 | public function cdata($parser, $cdata) |
336 | 342 | { |
337 | 343 | if ($this->current_xhtml_construct >= 0) |
@@ -344,6 +350,9 @@ discard block |
||
344 | 350 | } |
345 | 351 | } |
346 | 352 | |
353 | + /** |
|
354 | + * @param string $tag |
|
355 | + */ |
|
347 | 356 | public function tag_close($parser, $tag) |
348 | 357 | { |
349 | 358 | if ($this->current_xhtml_construct >= 0) |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | if ($declaration->parse()) |
121 | 121 | { |
122 | 122 | $data = substr($data, $pos + 2); |
123 | - $data = '<?xml version="' . $declaration->version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' . $data; |
|
123 | + $data = '<?xml version="'.$declaration->version.'" encoding="'.$encoding.'" standalone="'.(($declaration->standalone) ? 'yes' : 'no').'"?>'.$data; |
|
124 | 124 | } |
125 | 125 | else |
126 | 126 | { |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | xml_set_element_handler($xml, 'tag_open', 'tag_close'); |
152 | 152 | |
153 | 153 | // Parse! |
154 | - if (!xml_parse($xml, $data, true)) |
|
154 | + if ( ! xml_parse($xml, $data, true)) |
|
155 | 155 | { |
156 | 156 | $this->error_code = xml_get_error_code($xml); |
157 | 157 | $this->error_string = xml_error_string($this->error_code); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | case constant('XMLReader::END_ELEMENT'): |
177 | 177 | if ($xml->namespaceURI !== '') |
178 | 178 | { |
179 | - $tagName = $xml->namespaceURI . $this->separator . $xml->localName; |
|
179 | + $tagName = $xml->namespaceURI.$this->separator.$xml->localName; |
|
180 | 180 | } |
181 | 181 | else |
182 | 182 | { |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $empty = $xml->isEmptyElement; |
189 | 189 | if ($xml->namespaceURI !== '') |
190 | 190 | { |
191 | - $tagName = $xml->namespaceURI . $this->separator . $xml->localName; |
|
191 | + $tagName = $xml->namespaceURI.$this->separator.$xml->localName; |
|
192 | 192 | } |
193 | 193 | else |
194 | 194 | { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | { |
200 | 200 | if ($xml->namespaceURI !== '') |
201 | 201 | { |
202 | - $attrName = $xml->namespaceURI . $this->separator . $xml->localName; |
|
202 | + $attrName = $xml->namespaceURI.$this->separator.$xml->localName; |
|
203 | 203 | } |
204 | 204 | else |
205 | 205 | { |
@@ -305,12 +305,12 @@ discard block |
||
305 | 305 | $this->current_xhtml_construct++; |
306 | 306 | if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML) |
307 | 307 | { |
308 | - $this->data['data'] .= '<' . end($this->element); |
|
308 | + $this->data['data'] .= '<'.end($this->element); |
|
309 | 309 | if (isset($attribs[''])) |
310 | 310 | { |
311 | 311 | foreach ($attribs[''] as $name => $value) |
312 | 312 | { |
313 | - $this->data['data'] .= ' ' . $name . '="' . htmlspecialchars($value, ENT_COMPAT, $this->encoding) . '"'; |
|
313 | + $this->data['data'] .= ' '.$name.'="'.htmlspecialchars($value, ENT_COMPAT, $this->encoding).'"'; |
|
314 | 314 | } |
315 | 315 | } |
316 | 316 | $this->data['data'] .= '>'; |
@@ -318,8 +318,8 @@ discard block |
||
318 | 318 | } |
319 | 319 | else |
320 | 320 | { |
321 | - $this->datas[] =& $this->data; |
|
322 | - $this->data =& $this->data['child'][end($this->namespace)][end($this->element)][]; |
|
321 | + $this->datas[] = & $this->data; |
|
322 | + $this->data = & $this->data['child'][end($this->namespace)][end($this->element)][]; |
|
323 | 323 | $this->data = array('data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang)); |
324 | 324 | if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml') |
325 | 325 | || (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml') |
@@ -349,14 +349,14 @@ discard block |
||
349 | 349 | if ($this->current_xhtml_construct >= 0) |
350 | 350 | { |
351 | 351 | $this->current_xhtml_construct--; |
352 | - if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param'))) |
|
352 | + if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && ! in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param'))) |
|
353 | 353 | { |
354 | - $this->data['data'] .= '</' . end($this->element) . '>'; |
|
354 | + $this->data['data'] .= '</'.end($this->element).'>'; |
|
355 | 355 | } |
356 | 356 | } |
357 | 357 | if ($this->current_xhtml_construct === -1) |
358 | 358 | { |
359 | - $this->data =& $this->datas[count($this->datas) - 1]; |
|
359 | + $this->data = & $this->datas[count($this->datas) - 1]; |
|
360 | 360 | array_pop($this->datas); |
361 | 361 | } |
362 | 362 | |
@@ -370,12 +370,12 @@ discard block |
||
370 | 370 | public function split_ns($string) |
371 | 371 | { |
372 | 372 | static $cache = array(); |
373 | - if (!isset($cache[$string])) |
|
373 | + if ( ! isset($cache[$string])) |
|
374 | 374 | { |
375 | 375 | if ($pos = strpos($string, $this->separator)) |
376 | 376 | { |
377 | 377 | static $separator_length; |
378 | - if (!$separator_length) |
|
378 | + if ( ! $separator_length) |
|
379 | 379 | { |
380 | 380 | $separator_length = strlen($this->separator); |
381 | 381 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG2 || |
392 | 392 | $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG3 || |
393 | 393 | $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG4 || |
394 | - $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG5 ) |
|
394 | + $namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG5) |
|
395 | 395 | { |
396 | 396 | $namespace = SIMPLEPIE_NAMESPACE_MEDIARSS; |
397 | 397 | } |
@@ -81,8 +81,7 @@ discard block |
||
81 | 81 | if (strtoupper($encoding) === 'US-ASCII') |
82 | 82 | { |
83 | 83 | $this->encoding = 'UTF-8'; |
84 | - } |
|
85 | - else |
|
84 | + } else |
|
86 | 85 | { |
87 | 86 | $this->encoding = $encoding; |
88 | 87 | } |
@@ -121,8 +120,7 @@ discard block |
||
121 | 120 | { |
122 | 121 | $data = substr($data, $pos + 2); |
123 | 122 | $data = '<?xml version="' . $declaration->version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' . $data; |
124 | - } |
|
125 | - else |
|
123 | + } else |
|
126 | 124 | { |
127 | 125 | $this->error_string = 'SimplePie bug! Please report this!'; |
128 | 126 | return false; |
@@ -162,8 +160,7 @@ discard block |
||
162 | 160 | $this->current_byte = xml_get_current_byte_index($xml); |
163 | 161 | xml_parser_free($xml); |
164 | 162 | return $return; |
165 | - } |
|
166 | - else |
|
163 | + } else |
|
167 | 164 | { |
168 | 165 | libxml_clear_errors(); |
169 | 166 | $xml = new XMLReader(); |
@@ -177,8 +174,7 @@ discard block |
||
177 | 174 | if ($xml->namespaceURI !== '') |
178 | 175 | { |
179 | 176 | $tagName = $xml->namespaceURI . $this->separator . $xml->localName; |
180 | - } |
|
181 | - else |
|
177 | + } else |
|
182 | 178 | { |
183 | 179 | $tagName = $xml->localName; |
184 | 180 | } |
@@ -189,8 +185,7 @@ discard block |
||
189 | 185 | if ($xml->namespaceURI !== '') |
190 | 186 | { |
191 | 187 | $tagName = $xml->namespaceURI . $this->separator . $xml->localName; |
192 | - } |
|
193 | - else |
|
188 | + } else |
|
194 | 189 | { |
195 | 190 | $tagName = $xml->localName; |
196 | 191 | } |
@@ -200,8 +195,7 @@ discard block |
||
200 | 195 | if ($xml->namespaceURI !== '') |
201 | 196 | { |
202 | 197 | $attrName = $xml->namespaceURI . $this->separator . $xml->localName; |
203 | - } |
|
204 | - else |
|
198 | + } else |
|
205 | 199 | { |
206 | 200 | $attrName = $xml->localName; |
207 | 201 | } |
@@ -227,8 +221,7 @@ discard block |
||
227 | 221 | $this->current_line = $error->line; |
228 | 222 | $this->current_column = $error->column; |
229 | 223 | return false; |
230 | - } |
|
231 | - else |
|
224 | + } else |
|
232 | 225 | { |
233 | 226 | return true; |
234 | 227 | } |
@@ -284,8 +277,7 @@ discard block |
||
284 | 277 | $this->xml_base[] = $base; |
285 | 278 | $this->xml_base_explicit[] = true; |
286 | 279 | } |
287 | - } |
|
288 | - else |
|
280 | + } else |
|
289 | 281 | { |
290 | 282 | $this->xml_base[] = end($this->xml_base); |
291 | 283 | $this->xml_base_explicit[] = end($this->xml_base_explicit); |
@@ -294,8 +286,7 @@ discard block |
||
294 | 286 | if (isset($attribs[SIMPLEPIE_NAMESPACE_XML]['lang'])) |
295 | 287 | { |
296 | 288 | $this->xml_lang[] = $attribs[SIMPLEPIE_NAMESPACE_XML]['lang']; |
297 | - } |
|
298 | - else |
|
289 | + } else |
|
299 | 290 | { |
300 | 291 | $this->xml_lang[] = end($this->xml_lang); |
301 | 292 | } |
@@ -315,8 +306,7 @@ discard block |
||
315 | 306 | } |
316 | 307 | $this->data['data'] .= '>'; |
317 | 308 | } |
318 | - } |
|
319 | - else |
|
309 | + } else |
|
320 | 310 | { |
321 | 311 | $this->datas[] =& $this->data; |
322 | 312 | $this->data =& $this->data['child'][end($this->namespace)][end($this->element)][]; |
@@ -337,8 +327,7 @@ discard block |
||
337 | 327 | if ($this->current_xhtml_construct >= 0) |
338 | 328 | { |
339 | 329 | $this->data['data'] .= htmlspecialchars($cdata, ENT_QUOTES, $this->encoding); |
340 | - } |
|
341 | - else |
|
330 | + } else |
|
342 | 331 | { |
343 | 332 | $this->data['data'] .= $cdata; |
344 | 333 | } |
@@ -396,8 +385,7 @@ discard block |
||
396 | 385 | $namespace = SIMPLEPIE_NAMESPACE_MEDIARSS; |
397 | 386 | } |
398 | 387 | $cache[$string] = array($namespace, $local_name); |
399 | - } |
|
400 | - else |
|
388 | + } else |
|
401 | 389 | { |
402 | 390 | $cache[$string] = array('', $string); |
403 | 391 | } |
@@ -1,46 +1,46 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * SimplePie |
|
4 | - * |
|
5 | - * A PHP-Based RSS and Atom Feed Framework. |
|
6 | - * Takes the hard work out of managing a complete RSS/Atom solution. |
|
7 | - * |
|
8 | - * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors |
|
9 | - * All rights reserved. |
|
10 | - * |
|
11 | - * Redistribution and use in source and binary forms, with or without modification, are |
|
12 | - * permitted provided that the following conditions are met: |
|
13 | - * |
|
14 | - * * Redistributions of source code must retain the above copyright notice, this list of |
|
15 | - * conditions and the following disclaimer. |
|
16 | - * |
|
17 | - * * Redistributions in binary form must reproduce the above copyright notice, this list |
|
18 | - * of conditions and the following disclaimer in the documentation and/or other materials |
|
19 | - * provided with the distribution. |
|
20 | - * |
|
21 | - * * Neither the name of the SimplePie Team nor the names of its contributors may be used |
|
22 | - * to endorse or promote products derived from this software without specific prior |
|
23 | - * written permission. |
|
24 | - * |
|
25 | - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
|
26 | - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
27 | - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS |
|
28 | - * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
29 | - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
30 | - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
31 | - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
32 | - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
33 | - * POSSIBILITY OF SUCH DAMAGE. |
|
34 | - * |
|
35 | - * @package SimplePie |
|
36 | - * @version 1.3.1 |
|
37 | - * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue |
|
38 | - * @author Ryan Parman |
|
39 | - * @author Geoffrey Sneddon |
|
40 | - * @author Ryan McCue |
|
41 | - * @link http://simplepie.org/ SimplePie |
|
42 | - * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
43 | - */ |
|
3 | + * SimplePie |
|
4 | + * |
|
5 | + * A PHP-Based RSS and Atom Feed Framework. |
|
6 | + * Takes the hard work out of managing a complete RSS/Atom solution. |
|
7 | + * |
|
8 | + * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors |
|
9 | + * All rights reserved. |
|
10 | + * |
|
11 | + * Redistribution and use in source and binary forms, with or without modification, are |
|
12 | + * permitted provided that the following conditions are met: |
|
13 | + * |
|
14 | + * * Redistributions of source code must retain the above copyright notice, this list of |
|
15 | + * conditions and the following disclaimer. |
|
16 | + * |
|
17 | + * * Redistributions in binary form must reproduce the above copyright notice, this list |
|
18 | + * of conditions and the following disclaimer in the documentation and/or other materials |
|
19 | + * provided with the distribution. |
|
20 | + * |
|
21 | + * * Neither the name of the SimplePie Team nor the names of its contributors may be used |
|
22 | + * to endorse or promote products derived from this software without specific prior |
|
23 | + * written permission. |
|
24 | + * |
|
25 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS |
|
26 | + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
27 | + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS |
|
28 | + * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
29 | + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|
30 | + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
31 | + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
32 | + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
33 | + * POSSIBILITY OF SUCH DAMAGE. |
|
34 | + * |
|
35 | + * @package SimplePie |
|
36 | + * @version 1.3.1 |
|
37 | + * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue |
|
38 | + * @author Ryan Parman |
|
39 | + * @author Geoffrey Sneddon |
|
40 | + * @author Ryan McCue |
|
41 | + * @link http://simplepie.org/ SimplePie |
|
42 | + * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
43 | + */ |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Manages all author-related data |
@@ -222,6 +222,9 @@ discard block |
||
222 | 222 | $this->replace_url_attributes = (array) $element_attribute; |
223 | 223 | } |
224 | 224 | |
225 | + /** |
|
226 | + * @param string $data |
|
227 | + */ |
|
225 | 228 | public function sanitize($data, $type, $base = '') |
226 | 229 | { |
227 | 230 | $data = trim($data); |
@@ -381,6 +384,9 @@ discard block |
||
381 | 384 | return $data; |
382 | 385 | } |
383 | 386 | |
387 | + /** |
|
388 | + * @param string $html |
|
389 | + */ |
|
384 | 390 | protected function preprocess($html, $type) |
385 | 391 | { |
386 | 392 | $ret = ''; |
@@ -404,6 +410,9 @@ discard block |
||
404 | 410 | return $ret; |
405 | 411 | } |
406 | 412 | |
413 | + /** |
|
414 | + * @param DOMDocument $document |
|
415 | + */ |
|
407 | 416 | public function replace_urls($document, $tag, $attributes) |
408 | 417 | { |
409 | 418 | if (!is_array($attributes)) |
@@ -456,6 +465,9 @@ discard block |
||
456 | 465 | } |
457 | 466 | } |
458 | 467 | |
468 | + /** |
|
469 | + * @param DOMDocument $document |
|
470 | + */ |
|
459 | 471 | protected function strip_tag($tag, $document, $type) |
460 | 472 | { |
461 | 473 | $xpath = new DOMXPath($document); |
@@ -541,6 +553,9 @@ discard block |
||
541 | 553 | } |
542 | 554 | } |
543 | 555 | |
556 | + /** |
|
557 | + * @param DOMDocument $document |
|
558 | + */ |
|
544 | 559 | protected function strip_attr($attrib, $document) |
545 | 560 | { |
546 | 561 | $xpath = new DOMXPath($document); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | { |
230 | 230 | if ($type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML) |
231 | 231 | { |
232 | - if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data)) |
|
232 | + if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*'.SIMPLEPIE_PCRE_HTML_ATTRIBUTE.'>)/', $data)) |
|
233 | 233 | { |
234 | 234 | $type |= SIMPLEPIE_CONSTRUCT_HTML; |
235 | 235 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | if ($type & (SIMPLEPIE_CONSTRUCT_HTML | SIMPLEPIE_CONSTRUCT_XHTML)) |
248 | 248 | { |
249 | 249 | |
250 | - if (!class_exists('DOMDocument')) |
|
250 | + if ( ! class_exists('DOMDocument')) |
|
251 | 251 | { |
252 | 252 | $this->registry->call('Misc', 'error', array('DOMDocument not found, unable to use sanitizer', E_USER_WARNING, __FILE__, __LINE__)); |
253 | 253 | return ''; |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | |
312 | 312 | if ($cache->load()) |
313 | 313 | { |
314 | - $img->setAttribute('src', $this->image_handler . $image_url); |
|
314 | + $img->setAttribute('src', $this->image_handler.$image_url); |
|
315 | 315 | } |
316 | 316 | else |
317 | 317 | { |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | { |
323 | 323 | if ($cache->save(array('headers' => $file->headers, 'body' => $file->body))) |
324 | 324 | { |
325 | - $img->setAttribute('src', $this->image_handler . $image_url); |
|
325 | + $img->setAttribute('src', $this->image_handler.$image_url); |
|
326 | 326 | } |
327 | 327 | else |
328 | 328 | { |
@@ -350,12 +350,12 @@ discard block |
||
350 | 350 | |
351 | 351 | if ($this->remove_div) |
352 | 352 | { |
353 | - $data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '', $data); |
|
353 | + $data = preg_replace('/^<div'.SIMPLEPIE_PCRE_XML_ATTRIBUTE.'>/', '', $data); |
|
354 | 354 | $data = preg_replace('/<\/div>$/', '', $data); |
355 | 355 | } |
356 | 356 | else |
357 | 357 | { |
358 | - $data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '<div>', $data); |
|
358 | + $data = preg_replace('/^<div'.SIMPLEPIE_PCRE_XML_ATTRIBUTE.'>/', '<div>', $data); |
|
359 | 359 | } |
360 | 360 | } |
361 | 361 | |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | { |
389 | 389 | // Atom XHTML constructs are wrapped with a div by default |
390 | 390 | // Note: No protection if $html contains a stray </div>! |
391 | - $html = '<div>' . $html . '</div>'; |
|
391 | + $html = '<div>'.$html.'</div>'; |
|
392 | 392 | $ret .= '<!DOCTYPE html>'; |
393 | 393 | $content_type = 'text/html'; |
394 | 394 | } |
@@ -399,19 +399,19 @@ discard block |
||
399 | 399 | } |
400 | 400 | |
401 | 401 | $ret .= '<html><head>'; |
402 | - $ret .= '<meta http-equiv="Content-Type" content="' . $content_type . '; charset=utf-8" />'; |
|
403 | - $ret .= '</head><body>' . $html . '</body></html>'; |
|
402 | + $ret .= '<meta http-equiv="Content-Type" content="'.$content_type.'; charset=utf-8" />'; |
|
403 | + $ret .= '</head><body>'.$html.'</body></html>'; |
|
404 | 404 | return $ret; |
405 | 405 | } |
406 | 406 | |
407 | 407 | public function replace_urls($document, $tag, $attributes) |
408 | 408 | { |
409 | - if (!is_array($attributes)) |
|
409 | + if ( ! is_array($attributes)) |
|
410 | 410 | { |
411 | 411 | $attributes = array($attributes); |
412 | 412 | } |
413 | 413 | |
414 | - if (!is_array($this->strip_htmltags) || !in_array($tag, $this->strip_htmltags)) |
|
414 | + if ( ! is_array($this->strip_htmltags) || ! in_array($tag, $this->strip_htmltags)) |
|
415 | 415 | { |
416 | 416 | $elements = $document->getElementsByTagName($tag); |
417 | 417 | foreach ($elements as $element) |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | { |
436 | 436 | if ($this->encode_instead_of_strip) |
437 | 437 | { |
438 | - if (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style'))) |
|
438 | + if (isset($match[4]) && ! in_array(strtolower($match[1]), array('script', 'style'))) |
|
439 | 439 | { |
440 | 440 | $match[1] = htmlspecialchars($match[1], ENT_COMPAT, 'UTF-8'); |
441 | 441 | $match[2] = htmlspecialchars($match[2], ENT_COMPAT, 'UTF-8'); |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | return htmlspecialchars($match[0], ENT_COMPAT, 'UTF-8'); |
447 | 447 | } |
448 | 448 | } |
449 | - elseif (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style'))) |
|
449 | + elseif (isset($match[4]) && ! in_array(strtolower($match[1]), array('script', 'style'))) |
|
450 | 450 | { |
451 | 451 | return $match[4]; |
452 | 452 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | protected function strip_tag($tag, $document, $type) |
460 | 460 | { |
461 | 461 | $xpath = new DOMXPath($document); |
462 | - $elements = $xpath->query('body//' . $tag); |
|
462 | + $elements = $xpath->query('body//'.$tag); |
|
463 | 463 | if ($this->encode_instead_of_strip) |
464 | 464 | { |
465 | 465 | foreach ($elements as $element) |
@@ -467,9 +467,9 @@ discard block |
||
467 | 467 | $fragment = $document->createDocumentFragment(); |
468 | 468 | |
469 | 469 | // For elements which aren't script or style, include the tag itself |
470 | - if (!in_array($tag, array('script', 'style'))) |
|
470 | + if ( ! in_array($tag, array('script', 'style'))) |
|
471 | 471 | { |
472 | - $text = '<' . $tag; |
|
472 | + $text = '<'.$tag; |
|
473 | 473 | if ($element->hasAttributes()) |
474 | 474 | { |
475 | 475 | $attrs = array(); |
@@ -490,9 +490,9 @@ discard block |
||
490 | 490 | } |
491 | 491 | |
492 | 492 | // Standard attribute text |
493 | - $attrs[] = $name . '="' . $attr->value . '"'; |
|
493 | + $attrs[] = $name.'="'.$attr->value.'"'; |
|
494 | 494 | } |
495 | - $text .= ' ' . implode(' ', $attrs); |
|
495 | + $text .= ' '.implode(' ', $attrs); |
|
496 | 496 | } |
497 | 497 | $text .= '>'; |
498 | 498 | $fragment->appendChild(new DOMText($text)); |
@@ -505,9 +505,9 @@ discard block |
||
505 | 505 | $fragment->appendChild($child); |
506 | 506 | } |
507 | 507 | |
508 | - if (!in_array($tag, array('script', 'style'))) |
|
508 | + if ( ! in_array($tag, array('script', 'style'))) |
|
509 | 509 | { |
510 | - $fragment->appendChild(new DOMText('</' . $tag . '>')); |
|
510 | + $fragment->appendChild(new DOMText('</'.$tag.'>')); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | $element->parentNode->replaceChild($fragment, $element); |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | protected function strip_attr($attrib, $document) |
545 | 545 | { |
546 | 546 | $xpath = new DOMXPath($document); |
547 | - $elements = $xpath->query('//*[@' . $attrib . ']'); |
|
547 | + $elements = $xpath->query('//*[@'.$attrib.']'); |
|
548 | 548 | |
549 | 549 | foreach ($elements as $element) |
550 | 550 | { |
@@ -88,8 +88,7 @@ discard block |
||
88 | 88 | if ($page) |
89 | 89 | { |
90 | 90 | $this->image_handler = (string) $page; |
91 | - } |
|
92 | - else |
|
91 | + } else |
|
93 | 92 | { |
94 | 93 | $this->image_handler = false; |
95 | 94 | } |
@@ -143,13 +142,11 @@ discard block |
||
143 | 142 | if (is_array($tags)) |
144 | 143 | { |
145 | 144 | $this->strip_htmltags = $tags; |
146 | - } |
|
147 | - else |
|
145 | + } else |
|
148 | 146 | { |
149 | 147 | $this->strip_htmltags = explode(',', $tags); |
150 | 148 | } |
151 | - } |
|
152 | - else |
|
149 | + } else |
|
153 | 150 | { |
154 | 151 | $this->strip_htmltags = false; |
155 | 152 | } |
@@ -167,13 +164,11 @@ discard block |
||
167 | 164 | if (is_array($attribs)) |
168 | 165 | { |
169 | 166 | $this->strip_attributes = $attribs; |
170 | - } |
|
171 | - else |
|
167 | + } else |
|
172 | 168 | { |
173 | 169 | $this->strip_attributes = explode(',', $attribs); |
174 | 170 | } |
175 | - } |
|
176 | - else |
|
171 | + } else |
|
177 | 172 | { |
178 | 173 | $this->strip_attributes = false; |
179 | 174 | } |
@@ -232,8 +227,7 @@ discard block |
||
232 | 227 | if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data)) |
233 | 228 | { |
234 | 229 | $type |= SIMPLEPIE_CONSTRUCT_HTML; |
235 | - } |
|
236 | - else |
|
230 | + } else |
|
237 | 231 | { |
238 | 232 | $type |= SIMPLEPIE_CONSTRUCT_TEXT; |
239 | 233 | } |
@@ -312,8 +306,7 @@ discard block |
||
312 | 306 | if ($cache->load()) |
313 | 307 | { |
314 | 308 | $img->setAttribute('src', $this->image_handler . $image_url); |
315 | - } |
|
316 | - else |
|
309 | + } else |
|
317 | 310 | { |
318 | 311 | $file = $this->registry->create('File', array($img->getAttribute('src'), $this->timeout, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen)); |
319 | 312 | $headers = $file->headers; |
@@ -323,8 +316,7 @@ discard block |
||
323 | 316 | if ($cache->save(array('headers' => $file->headers, 'body' => $file->body))) |
324 | 317 | { |
325 | 318 | $img->setAttribute('src', $this->image_handler . $image_url); |
326 | - } |
|
327 | - else |
|
319 | + } else |
|
328 | 320 | { |
329 | 321 | trigger_error("$this->cache_location is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING); |
330 | 322 | } |
@@ -352,8 +344,7 @@ discard block |
||
352 | 344 | { |
353 | 345 | $data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '', $data); |
354 | 346 | $data = preg_replace('/<\/div>$/', '', $data); |
355 | - } |
|
356 | - else |
|
347 | + } else |
|
357 | 348 | { |
358 | 349 | $data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '<div>', $data); |
359 | 350 | } |
@@ -391,8 +382,7 @@ discard block |
||
391 | 382 | $html = '<div>' . $html . '</div>'; |
392 | 383 | $ret .= '<!DOCTYPE html>'; |
393 | 384 | $content_type = 'text/html'; |
394 | - } |
|
395 | - else |
|
385 | + } else |
|
396 | 386 | { |
397 | 387 | $ret .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; |
398 | 388 | $content_type = 'application/xhtml+xml'; |
@@ -440,17 +430,14 @@ discard block |
||
440 | 430 | $match[1] = htmlspecialchars($match[1], ENT_COMPAT, 'UTF-8'); |
441 | 431 | $match[2] = htmlspecialchars($match[2], ENT_COMPAT, 'UTF-8'); |
442 | 432 | return "<$match[1]$match[2]>$match[3]</$match[1]>"; |
443 | - } |
|
444 | - else |
|
433 | + } else |
|
445 | 434 | { |
446 | 435 | return htmlspecialchars($match[0], ENT_COMPAT, 'UTF-8'); |
447 | 436 | } |
448 | - } |
|
449 | - elseif (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style'))) |
|
437 | + } elseif (isset($match[4]) && !in_array(strtolower($match[1]), array('script', 'style'))) |
|
450 | 438 | { |
451 | 439 | return $match[4]; |
452 | - } |
|
453 | - else |
|
440 | + } else |
|
454 | 441 | { |
455 | 442 | return ''; |
456 | 443 | } |
@@ -514,8 +501,7 @@ discard block |
||
514 | 501 | } |
515 | 502 | |
516 | 503 | return; |
517 | - } |
|
518 | - elseif (in_array($tag, array('script', 'style'))) |
|
504 | + } elseif (in_array($tag, array('script', 'style'))) |
|
519 | 505 | { |
520 | 506 | foreach ($elements as $element) |
521 | 507 | { |
@@ -523,8 +509,7 @@ discard block |
||
523 | 509 | } |
524 | 510 | |
525 | 511 | return; |
526 | - } |
|
527 | - else |
|
512 | + } else |
|
528 | 513 | { |
529 | 514 | foreach ($elements as $element) |
530 | 515 | { |