• R/O
  • HTTP
  • SSH
  • HTTPS

pukiwiki: Commit


Commit MetaInfo

Revisiona6ed3648d96b764b83c2161a9062c36c8dcb1f00 (tree)
Time2016-02-07 22:26:58
Authorumorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack2/230 Do nothing on updating page with unchanged content

Change Summary

Incremental Difference

--- a/lib/file.php
+++ b/lib/file.php
@@ -88,8 +88,14 @@ function page_write($page, $postdata, $notimestamp = FALSE)
8888 $postdata = add_author_info($text_without_author);
8989 $is_delete = empty($text_without_author);
9090
91- // Create and write diff
91+ // Do nothing when it has no changes
9292 $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
9399 $diffdata = do_diff($oldpostdata, $postdata);
94100 file_write(DIFF_DIR, $page, $diffdata);
95101
Show on old repository browser