
PS E:\wwwroot\channel-pub-api> ./yii pub-article-queue/run --verbose=1 --isolate=1 --color=0
2020-02-10 16:46:03 [pid: 550884] - Worker is started
2020-02-10 16:46:04 [81] common\jobs\PubArticleJob (attempt: 1, pid: 550884) - Started
2020-02-10 16:46:04 [81] common\jobs\PubArticleJob (attempt: 1, pid: 550884) - Error (0.547 s)
> yii\web\ServerErrorHttpException: Weibo's micro-connected web application interface HTTP request, third party sharing
a link to Weibo failed, status code: 400, error code: 20012, error message: Text too long, please input text less than
140 characters!
2020-02-10 16:46:04 [pid: 550884] - Worker is stopped (0:00:01)

文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章https://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html
10000(发布成功)
130(字符串长度,已经删除掉 URL) 181(字符串长度,保留 URL) 130(weibo,字符串长度,已经删除掉 URL)
文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章1内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章https://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html
202153(发布失败)
131(字符串长度,已经删除掉 URL) 182(字符串长度,保留 URL) 131(weibo,字符串长度,已经删除掉 URL)
文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章11111111内容文章内容文章内容文章内容文章https://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html
10000(发布成功)
134(字符串长度,已经删除掉 URL) 185(字符串长度,保留 URL) 130(weibo,字符串长度,已经删除掉 URL)
文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章https://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章11111111
10000(发布成功)
134(字符串长度,已经删除掉 URL) 185(字符串长度,保留 URL) 130(weibo,字符串长度,已经删除掉 URL)


/**
* Validates the content.
* This method serves as the inline validation for content.
*
* @param string $attribute the attribute currently being validated
* @param array $params the additional name-value pairs given in the rule
*/
public function validateContent($attribute, $params)
{
if (!$this->hasErrors()) {
// 检查安全域名列表中的域名是否存在于文章内容中
$safeDomainNames = explode(",", Yii::$app->params['weiboAuth']['weiboConnectWebApp']['safeDomainName']);
$isExist = false; // 是否存在
foreach ($safeDomainNames as $safeDomainName) {
$httpPos = stripos($this->$attribute, 'http://' . $safeDomainName);
$httpsPos = stripos($this->$attribute, 'https://' . $safeDomainName);
// 判断安全域名是否存在,如果存在,则退出循环
if ($httpPos !== false || $httpsPos !== false) {
$isExist = true;
break;
}
}
if (!$isExist) {
$this->addError($attribute, Yii::t('error', '244009'));
}
// 从文章内容中删除 URL
$content = preg_replace('/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', '', $this->$attribute);
// 获取字符串长度,一个汉字表示两个长度
$length = StringHelper::strlenTwo($content);
// 文章内容只能包含至多130个字符
if ($length > 260) {
$this->addError($attribute, Yii::t('error', '244010'));
}
}
}

文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章https://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html
10000(发布成功)
130(字符串长度,已经删除掉 URL) 181(字符串长度,保留 URL) 130(weibo,字符串长度,已经删除掉 URL)
$content:文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章
$length:260
文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章1内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章https://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html
202153(发布失败)
131(字符串长度,已经删除掉 URL) 182(字符串长度,保留 URL) 131(weibo,字符串长度,已经删除掉 URL)
$content:文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章1内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章
$length:261
文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章11111111内容文章内容文章内容文章内容文章https://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html
10000(发布成功)
134(字符串长度,已经删除掉 URL) 185(字符串长度,保留 URL) 130(weibo,字符串长度,已经删除掉 URL)
$content:文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章11111111内容文章内容文章内容文章内容文章
$length:260
文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章https://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章11111111
10000(发布成功)
134(字符串长度,已经删除掉 URL) 185(字符串长度,保留 URL) 130(weibo,字符串长度,已经删除掉 URL)
$content:文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章11111111
$length:260
文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容00https://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html
202153(发布失败)
130(字符串长度,已经删除掉 URL) 181(字符串长度,保留 URL) 129(weibo,字符串长度,已经删除掉 URL)
$content:文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容00https://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html
$length:309
文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章aahttps://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章11111111
202153(发布失败)
136(字符串长度,已经删除掉 URL) 187(字符串长度,保留 URL) 131(weibo,字符串长度,已经删除掉 URL)
$content:文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章aahttps://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章11111111
$length:313
$content = preg_replace('/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', '', $this->$attribute);
$regex = "@(https?://([-\w\.]+[-\w])+(:\d+)?(/([\w/_\.#-]*(\?\S+)?[^\.\s])?).*$)@";
echo preg_replace($regex, ' ', $string);
$content = preg_replace('/(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', '', $this->$attribute); // 删除:\b
文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容00https://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html
202153(发布失败)
130(字符串长度,已经删除掉 URL) 181(字符串长度,保留 URL) 129(weibo,字符串长度,已经删除掉 URL)
$content:文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容00
$length:258
文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章aahttps://wjdev.chinamcloud.cn/www/wwwwss/wwwwww.html内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章11111111
202153(发布失败)
136(字符串长度,已经删除掉 URL) 187(字符串长度,保留 URL) 131(weibo,字符串长度,已经删除掉 URL)
$content:文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章aa内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章内容文章11111111
$length:262
需要长期技术维护或远程问题排查?
我是拥有 15+ 年经验的 PHP / Go 后端工程师,长期关注已有系统维护、Bug 修复、性能优化、服务器排查、WordPress 网站维护和小功能迭代。
如果你的项目遇到以下情况,可以先从一次小问题排查开始合作:
- ✅ PHP / Laravel / Yii2 老项目无人维护
- ✅ Go / Gin 后端接口需要排查或优化
- ✅ WordPress 网站访问慢、报错或插件冲突
- ✅ Nginx / MySQL / Redis / Linux 服务器异常
- ✅ CDN / Cloudflare / DNS / HTTPS 配置问题
- ✅ 需要长期远程技术支持或兼职维护
更多介绍请查看:关于我 & 合作
微信:13980074657
邮箱:shuijingwanwq@gmail.com
Telegram:@shuijingwan
GitHub:https://github.com/shuijingwan

发表回复