升级X2.5 20130426之后, 站外的SWF调用就无法播放了,问题出在Discuzcode方法封装里面。- git diff HEAD^..HEAD source/function/function_discuzcode.php
- diff --git a/source/function/function_discuzcode.php b/source/function/function_discuzcode.php
- index 0ec8d2f..1fbfa64 100755
- --- a/source/function/function_discuzcode.php
- +++ b/source/function/function_discuzcode.php
- @@ -4,7 +4,7 @@
- * [Discuz!] (C)2001-2099 Comsenz Inc.
- * This is NOT a freeware, use is subject to license terms
- *
- - * $Id: function_discuzcode.php 30926 2012-07-02 05:48:08Z chenmengshu $
- + * $Id: function_discuzcode.php 33109 2013-04-26 03:59:30Z andyzheng $
- */
- if(!defined('IN_DISCUZ')) {
- @@ -270,13 +270,13 @@ function parseurl($url, $text, $scheme) {
- function parseflash($w, $h, $url) {
- $w = !$w ? 550 : $w;
- $h = !$h ? 400 : $h;
- - preg_match("/((https?){1}:\/\/|www\.)[^\["']+/i", $url, $matches);
- + preg_match("/((https?){1}:\/\/|www\.)[^\["']+\.swf/i", $url, $matches);
复制代码 .swf之后的就被截掉了,导致优酷,土豆,乐视等站点的swf调用无法播放。
解决问题的办法,是改成:- diff --git a/source/function/function_discuzcode.php b/source/function/function_discuzcode.php
- index 1fbfa64..a53b32b 100755
- --- a/source/function/function_discuzcode.php
- +++ b/source/function/function_discuzcode.php
- @@ -270,7 +270,7 @@ function parseurl($url, $text, $scheme) {
- function parseflash($w, $h, $url) {
- $w = !$w ? 550 : $w;
- $h = !$h ? 400 : $h;
- - preg_match("/((https?){1}:\/\/|www\.)[^\["']+\.swf/i", $url, $matches);
- + preg_match("/((https?){1}:\/\/|www\.)[^\["']+\.swf.*/i", $url, $matches);
- $url = $matches[0];
- $randomid = 'swf_'.random(3);
- if(fileext($url) != 'flv') {
- @@ -650,4 +650,4 @@ function parsesmiles(&$message) {
- return $message;
- }
- -?>
- \ No newline at end of file
- +?>
复制代码 |