Download Monitor バグ?

1
1153

XPressME Integration Kit のサイトで WordPress Download Monitorプラグインを利用しているのですが、

最新のVer3.3.3.10にアップグレードしたところ、タグが正しく処理されなくなってしまいました。

カスタムフォーマットで

 {date,"Y-m-d"} <a title="Downloaded {hits} times" href="{url}">{title}</a>     ({size}) ({hits} Downloads)

みたいなフォーマットを書いているのですが最初のタグ{date,”Y-m-d”} がタグとして処理されず、そのまま出力されてしまいます。

で、コードを参照してみたのですが
classes/downloadable_file.class.php line 497

		if (strpos($format, '{date,')) :
			preg_match("/{date,\s*\"([^\"]*?)\"}/", $format, $match);
			if ($match) {
				$fpatts[] = $match[0];
				if ($this->postDate) $fsubs[] = date_i18n($match[1],strtotime($this->postDate)); else $fsubs[]  = "";
			}
		endif;

の部分でstrpos($format, ‘{date,’)が値0を返すために処理されないようです。

		if (strpos($format, '{date,')) :

		if (strpos($format, '{date,') !== false) :

に変更することで修正が可能です。
あるいは

		if (strpos($format, '{date,')) :
			preg_match("/{date,\s*\"([^\"]*?)\"}/", $format, $match);
			if ($match) {
				$fpatts[] = $match[0];
				if ($this->postDate) $fsubs[] = date_i18n($match[1],strtotime($this->postDate)); else $fsubs[]  = "";
			}
		endif;

		if(preg_match("/{date,\s*\"([^\"]*?)\"}/", $format, $match)){
			$fpatts[] = $match[0];
			if ($this->postDate) $fsubs[] = date_i18n($match[1],strtotime($this->postDate)); else $fsubs[]  = "";
		}

としてもOKかな
ほかのタグについても同様です。

こちらは、作者のフォーラムにバグとして報告させていただきました。

1コメント

返事を書く

あなたのコメントを入力してください。
ここにあなたの名前を入力してください

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください