|
@@ -208,28 +208,28 @@ class Parser
|
|
|
{
|
|
|
public static function parse($str)
|
|
|
{
|
|
|
- $pairs = self::matchPairs($str);
|
|
|
- if ($pairs) {
|
|
|
- $params = [];
|
|
|
-
|
|
|
- $pattern_time_format = "/\d{4}\-\d{2}\-\d{2}\s+\d{2}\:\d{2}\:\d{2}/";
|
|
|
- $matched = preg_match_all($pattern_time_format, $str, $matches);
|
|
|
- if ($matched) {
|
|
|
- if (isset($matches[0][0])) {
|
|
|
- $params['time'] = $matches[0][0];
|
|
|
- }
|
|
|
- unset($matches);
|
|
|
+ $params = [];
|
|
|
+ $pattern_time_format = "/\d{4}\-\d{2}\-\d{2}\s+\d{2}\:\d{2}\:\d{2}/";
|
|
|
+ $matched = preg_match_all($pattern_time_format, $str, $matches);
|
|
|
+ if ($matched) {
|
|
|
+ if (isset($matches[0][0])) {
|
|
|
+ $params['time'] = $matches[0][0];
|
|
|
}
|
|
|
+ unset($matches);
|
|
|
+ }
|
|
|
|
|
|
- $pattern_thead_id = "/^\[\d+/";
|
|
|
- $matched = preg_match_all($pattern_thead_id, $str, $matches);
|
|
|
- if ($matched) {
|
|
|
- if (isset($matches[0][0])) {
|
|
|
- $params['thread_id'] = str_replace("[","", $matches[0][0]);
|
|
|
- }
|
|
|
- unset($matches);
|
|
|
+ $pattern_thead_id = "/^\[\d+/";
|
|
|
+ $matched = preg_match_all($pattern_thead_id, $str, $matches);
|
|
|
+ if ($matched) {
|
|
|
+ if (isset($matches[0][0])) {
|
|
|
+ $params['thread_id'] = str_replace("[","", $matches[0][0]);
|
|
|
}
|
|
|
+ unset($matches);
|
|
|
+ }
|
|
|
|
|
|
+ $strings = substr($str, strpos($str, "content=") +8);
|
|
|
+ $pairs = self::matchPairs($strings);
|
|
|
+ if ($pairs) {
|
|
|
foreach ($pairs as $pair)
|
|
|
{
|
|
|
$kv = explode("=", $pair);
|