Subversion Repositories SvarDOS

Rev

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

Rev 922 Rev 923
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"
-
 
134
  if (preg_match('/^[0-3][0-9]-(jan|feb|mar|apr|jun|jul|aug|sep|oct|nov|dec)-([0-9][0-9]){1,2}$/', $verstr)) {
-
 
135
    $dy = substr($verstr, 0, 2);
-
 
136
    $mo = substr($verstr, 3, 3);
-
 
137
    $ye = substr($verstr, 7);
-
 
138
    $verstr = "{$ye}{$mo}{$dy}";
-
 
139
  }
-
 
140
 
-
 
141
  // 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|jun|jul|aug|sep|oct|nov|dec)([0-9][0-9]){1,2}$/', $verstr)) {
-
 
143
    $months = array('jan' => 1, 'feb' => 2, 'mar' => 3, 'apr' => 4, 'may' => 5, 'jun' => 6, 'jul' => 7, 'aug' => 8, 'sep' => 9, 'oct' => 10, 'nov' => 11, 'dec' => 12);
-
 
144
    $dy = substr($verstr, 0, 2);
-
 
145
    $mo = $months[substr($verstr, 2, 3)];
-
 
146
    $ye = substr($verstr, 5);
-
 
147
    $verstr = "{$ye}.{$mo}.{$dy}";
-
 
148
  }
-
 
149
 
133
  // validate the format is supported, should be something no more complex than 1.05.3.33
150
  // validate the format is supported, should be something no more complex than 1.05.3.33
134
  if (! preg_match('/^[0-9][0-9.]{0,20}$/', $verstr)) {
151
  if (! preg_match('/^[0-9][0-9.]{0,20}$/', $verstr)) {
135
    return(false);
152
    return(false);
136
  }
153
  }
137
 
154