~ubuntu-branches/ubuntu/trusty/moodle/trusty

« back to all changes in this revision

Viewing changes to cache/stores/memcache/lib.php

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-01-21 13:40:52 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20140121134052-ym2qvsp2cd9vq0p6
Tags: 2.5.4-1
* New upstream release, fixing security issues:
  - MSA-14-0001 Config passwords visibility issue [CVE-2014-0008]
  - MSA-14-0002 Group constraints lacking in "login as" [CVE-2014-0009]
  - MSA-14-0003 CSRF vulnerability in profile fields [CVE-2014-0010]
* Move /var/lib/moodle directory into package.
* Revert back to bundled yui3. Unfortunately, version in Debian and
  of upstream are not compatible (closes: #735312).

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
 
132
132
        $this->connection = new Memcache;
133
133
        foreach ($this->servers as $server) {
134
 
            $this->connection->addServer($server[0], $server[1], true, $server[2]);
 
134
            $this->connection->addServer($server[0], (int) $server[1], true, (int) $server[2]);
135
135
        }
136
136
        // Test the connection to the pool of servers.
137
137
        $this->isready = @$this->connection->set($this->parse_key('ping'), 'ping', MEMCACHE_COMPRESSED, 1);
350
350
        $lines = explode("\n", $data->servers);
351
351
        $servers = array();
352
352
        foreach ($lines as $line) {
353
 
            $line = trim($line, ':');
 
353
            // Trim surrounding colons and default whitespace.
 
354
            $line = trim(trim($line), ":");
 
355
            // Skip blank lines.
 
356
            if ($line === '') {
 
357
                continue;
 
358
            }
354
359
            $servers[] = explode(':', $line, 3);
355
360
        }
356
361
        return array(