PukiWiki
Revision | a6ed3648d96b764b83c2161a9062c36c8dcb1f00 (tree) |
---|---|
Time | 2016-02-07 22:26:58 |
Author | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack2/230 Do nothing on updating page with unchanged content
@@ -88,8 +88,14 @@ function page_write($page, $postdata, $notimestamp = FALSE) | ||
88 | 88 | $postdata = add_author_info($text_without_author); |
89 | 89 | $is_delete = empty($text_without_author); |
90 | 90 | |
91 | - // Create and write diff | |
91 | + // Do nothing when it has no changes | |
92 | 92 | $oldpostdata = is_page($page) ? join('', get_source($page)) : ''; |
93 | + $oldtext_without_author = remove_author_info($oldpostdata); | |
94 | + if ($text_without_author === $oldtext_without_author) { | |
95 | + // Do nothing on updating with unchanged content | |
96 | + return; | |
97 | + } | |
98 | + // Create and write diff | |
93 | 99 | $diffdata = do_diff($oldpostdata, $postdata); |
94 | 100 | file_write(DIFF_DIR, $page, $diffdata); |
95 | 101 |