#!/usr/bin/env php replaceImgURL(); cid=16524 - 不传入任何数据。 @0 - 不传入 editorList 参数。属性step @ baidu https://www.zentao.net - 字段中不存在 editorList 参数的数据。属性step @ baidu https://www.zentao.net - 正常传入参数。属性step @ baidu https://www.zentao.net - 正常传入参数,但是 requestType = GET。属性step @ baidu https://www.zentao.net */ include dirname(__FILE__, 5) . '/test/lib/init.php'; su('admin'); global $tester; $fileModel = $tester->loadModel('file'); $fileModel->config->requestType = 'PATH_INFO'; $fileModel->config->webRoot = '/'; $fileModel->app->methodName = 'view'; $file = new stdclass(); $file->step = ' baidu https://www.zentao.net'; r(get_object_vars($fileModel->replaceImgURL(new stdclass(), '', ''))) && p() && e('0'); //不传入任何数据。 r($fileModel->replaceImgURL($file, '')) && p('step') && e(' baidu https://www.zentao.net'); //不传入 editorList 参数。 r($fileModel->replaceImgURL($file, 'content')) && p('step') && e(' baidu https://www.zentao.net'); //字段中不存在 editorList 参数的数据。 r($fileModel->replaceImgURL($file, 'step')) && p('step') && e(' baidu https://www.zentao.net'); //正常传入参数。 $fileModel->config->requestType = 'GET'; $file->step = ' baidu https://www.zentao.net'; r($fileModel->replaceImgURL($file, 'step')) && p('step') && e(' baidu https://www.zentao.net'); //正常传入参数,但是 requestType = GET。