Skip to content

关于wechat类文本回复的换行问题(BUG) #359

Description

@joyokim
	/**
	 * 过滤文字回复\r\n换行符
	 * @param string $text
	 * @return string|mixed
	 */
	private function _auto_text_filter($text) {
		if (!$this->_text_filter) return $text;
		return str_replace("\r\n", "\n", $text);
	}

以上为实现文本消息回复的换行,其中str_replace("\r\n", "\n", $text);是无法识别到\r\n.

正确应为
return str_replace("\\r\\n", "\n", $text);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions