Permalink
Browse files

auto-update YOURLS version in database

Addresses #2501 by checking `YOURLS_VERSION` against the stored value in the database during `yourls_upgrade_is_needed()` and triggering an update to the stored value if base code version is greater.
  • Loading branch information...
joshp23 committed Jan 27, 2019
1 parent c527a5c commit e6e8c16204c347c4858cd725efe41f8ea9c87c7b
Showing with 4 additions and 0 deletions.
  1. +4 −0 includes/functions.php
@@ -1060,6 +1060,10 @@ function yourls_upgrade_is_needed() {
if( $currentsql < YOURLS_DB_VERSION )
return true;
// Check if YOURLS_VERSION exist && match value stored in YOURLS_DB_TABLE_OPTIONS, update DB if required
if( $currentver < YOURLS_VERSION )
yourls_update_option( 'version', YOURLS_VERSION );
return false;
}

0 comments on commit e6e8c16

Please sign in to comment.