Subversion Repositories SvarDOS

Rev

Rev 925 | Rev 927 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 925 Rev 926
Line 128... Line 128...
128
  if (preg_match('/[a-z]$/', $verstr)) {
128
  if (preg_match('/[a-z]$/', $verstr)) {
129
    $subver[0] = ord(substr($verstr, -1));
129
    $subver[0] = ord(substr($verstr, -1));
130
    $verstr = substr_replace($verstr, '', -1); // remove last character from string
130
    $verstr = substr_replace($verstr, '', -1); // remove last character from string
131
  }
131
  }
132
 
132
 
133
  // convert "30-jan-99" and "30-jan-1999" versions to "30jan99" and "30jan1999"
133
  // convert "30-jan-99", "1999-jan-30" and "30-jan-1999" versions to "30jan99" or "30jan1999"
-
 
134
  // note that dashes have already been replaced by dots
134
  if (preg_match('/^[0-3][0-9].(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec).([0-9][0-9]){1,2}$/', $verstr)) {
135
  if (preg_match('/^([0-9][0-9]){1,2}\.(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\.([0-9][0-9]){1,2}$/', $verstr)) {
-
 
136
    $verstr = str_replace('.', '', $verstr);
-
 
137
  }
-
 
138
 
-
 
139
  // convert "2009mar17" versions to "17mar2009"
-
 
140
  if (preg_match('/^[0-9]{4}(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[0-9]{2}$/', $verstr)) {
135
    $dy = substr($verstr, 0, 2);
141
    $dy = substr($verstr, 7);
136
    $mo = substr($verstr, 3, 3);
142
    $mo = substr($verstr, 4, 3);
137
    $ye = substr($verstr, 7);
143
    $ye = substr($verstr, 0, 4);
138
    $verstr = "{$dy}{$mo}{$ye}";
144
    $verstr = "{$dy}{$mo}{$ye}";
139
  }
145
  }
140
 
146
 
141
  // convert "30jan99" versions to 99.1.30 and "30jan1999" to 1999.1.30
147
  // convert "30jan99" versions to 99.1.30 and "30jan1999" to 1999.1.30
142
  if (preg_match('/^[0-3][0-9](jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)([0-9][0-9]){1,2}$/', $verstr)) {
148
  if (preg_match('/^[0-3][0-9](jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)([0-9][0-9]){1,2}$/', $verstr)) {