Discuz教程网

站外SWF视频无法播放

[复制链接]
authicon edwardz82 发表于 2013-3-31 19:28:42 | 显示全部楼层 |阅读模式
升级X2.5 20130426之后, 站外的SWF调用就无法播放了,问题出在Discuzcode方法封装里面。
  1. git diff HEAD^..HEAD source/function/function_discuzcode.php
  2. diff --git a/source/function/function_discuzcode.php b/source/function/function_discuzcode.php
  3. index 0ec8d2f..1fbfa64 100755
  4. --- a/source/function/function_discuzcode.php
  5. +++ b/source/function/function_discuzcode.php
  6. @@ -4,7 +4,7 @@
  7. * [Discuz!] (C)2001-2099 Comsenz Inc.
  8. * This is NOT a freeware, use is subject to license terms
  9. *
  10. - * $Id: function_discuzcode.php 30926 2012-07-02 05:48:08Z chenmengshu $
  11. + * $Id: function_discuzcode.php 33109 2013-04-26 03:59:30Z andyzheng $
  12. */
  13. if(!defined('IN_DISCUZ')) {
  14. @@ -270,13 +270,13 @@ function parseurl($url, $text, $scheme) {
  15. function parseflash($w, $h, $url) {
  16. $w = !$w ? 550 : $w;
  17. $h = !$h ? 400 : $h;
  18. - preg_match("/((https?){1}://|www.)[^["']+/i", $url, $matches);
  19. + preg_match("/((https?){1}://|www.)[^["']+.swf/i", $url, $matches);
复制代码
.swf之后的就被截掉了,导致优酷,土豆,乐视等站点的swf调用无法播放。

解决问题的办法,是改成:
  1. diff --git a/source/function/function_discuzcode.php b/source/function/function_discuzcode.php
  2. index 1fbfa64..a53b32b 100755
  3. --- a/source/function/function_discuzcode.php
  4. +++ b/source/function/function_discuzcode.php
  5. @@ -270,7 +270,7 @@ function parseurl($url, $text, $scheme) {
  6. function parseflash($w, $h, $url) {
  7. $w = !$w ? 550 : $w;
  8. $h = !$h ? 400 : $h;
  9. - preg_match("/((https?){1}://|www.)[^["']+.swf/i", $url, $matches);
  10. + preg_match("/((https?){1}://|www.)[^["']+.swf.*/i", $url, $matches);
  11. $url = $matches[0];
  12. $randomid = 'swf_'.random(3);
  13. if(fileext($url) != 'flv') {
  14. @@ -650,4 +650,4 @@ function parsesmiles(&$message) {
  15. return $message;
  16. }
  17. -?>
  18. No newline at end of file
  19. +?>
复制代码



上一篇:精华帖子数量,不显示0
下一篇:X3公告标题提交后消失
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-7-7 23:22

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表