~ubuntu-branches/ubuntu/hardy/squirrelmail/hardy-updates

« back to all changes in this revision

Viewing changes to functions/strings.php

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst, Jeroen van Wolffelaar, Thijs Kinkhorst
  • Date: 2005-08-15 21:06:00 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050815210600-qxvat452exjqg64j
Tags: 2:1.4.5-2
[ Jeroen van Wolffelaar ]
* Restore squirrelmail-configure manpage, accidently dropped in -1
* Use debhelper compat level 4

[ Thijs Kinkhorst ]
* Drop obsolete symlink for attachment dir.
* Do not ship upstream README, which contains hardly any information
  relevant to Debian. Extend README.Debian a bit. Thanks W. Borgert.
* Add years to copyright statement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 * This code provides various string manipulation functions that are
10
10
 * used by the rest of the Squirrelmail code.
11
11
 *
12
 
 * @version $Id: strings.php,v 1.184.2.30 2005/01/22 03:35:33 jangliss Exp $
 
12
 * @version $Id: strings.php,v 1.184.2.35 2005/07/13 18:37:52 jangliss Exp $
13
13
 * @package squirrelmail
14
14
 */
15
15
 
17
17
 * SquirrelMail version number -- DO NOT CHANGE
18
18
 */
19
19
global $version;
20
 
$version = '1.4.4';
 
20
$version = '1.4.5';
21
21
 
22
22
/**
23
23
 * SquirrelMail internal version number -- DO NOT CHANGE
24
24
 * $sm_internal_version = array (release, major, minor)
25
25
 */
26
26
global $SQM_INTERNAL_VERSION;
27
 
$SQM_INTERNAL_VERSION = array(1,4,4);
 
27
$SQM_INTERNAL_VERSION = array(1,4,5);
28
28
 
29
29
/**
30
30
 * There can be a circular issue with includes, where the $version string is
273
273
 */
274
274
function OneTimePadEncrypt ($string, $epad) {
275
275
    $pad = base64_decode($epad);
 
276
 
 
277
    if (strlen($pad)>0) {
 
278
        // make sure that pad is longer than string
 
279
        while (strlen($string)>strlen($pad)) {
 
280
            $pad.=$pad;
 
281
        }
 
282
    } else {
 
283
        // FIXME: what should we do when $epad is not base64 encoded or empty.
 
284
    }
 
285
 
276
286
    $encrypted = '';
277
287
    for ($i = 0; $i < strlen ($string); $i++) {
278
288
        $encrypted .= chr (ord($string[$i]) ^ ord($pad[$i]));
293
303
 */
294
304
function OneTimePadDecrypt ($string, $epad) {
295
305
    $pad = base64_decode($epad);
 
306
 
 
307
    if (strlen($pad)>0) {
 
308
        // make sure that pad is longer than string
 
309
        while (strlen($string)>strlen($pad)) {
 
310
            $pad.=$pad;
 
311
        }
 
312
    } else {
 
313
        // FIXME: what should we do when $epad is not base64 encoded or empty.
 
314
    }
 
315
 
296
316
    $encrypted = base64_decode ($string);
297
317
    $decrypted = '';
298
318
    for ($i = 0; $i < strlen ($encrypted); $i++) {