Skip to content
Browse files

lib, auth, webservice: MDL-20876 fix deprecated split() calls.

  • Loading branch information...
1 parent bed733c commit 7785dc2e9f717b471b4711648a180523b4eb0352 @doctorlard doctorlard committed
View
2 auth/imap/auth.php
@@ -46,7 +46,7 @@ function user_login ($username, $password) {
}
global $CFG;
- $hosts = split(';', $this->config->host); // Could be multiple hosts
+ $hosts = explode(';', $this->config->host); // Could be multiple hosts
foreach ($hosts as $host) { // Try each host in turn
$host = trim($host);
View
2 auth/nntp/auth.php
@@ -48,7 +48,7 @@ function user_login ($username, $password) {
global $CFG;
// try each multiple host
- $hosts = split(';', $this->config->host);
+ $hosts = explode(';', $this->config->host);
foreach ($hosts as $host) {
$host = '{' . trim($host) . ':' . $this->config->port . '/nntp}';
View
2 auth/pop3/auth.php
@@ -46,7 +46,7 @@ function user_login($username, $password) {
}
global $CFG;
- $hosts = split(';', $this->config->host); // Could be multiple hosts
+ $hosts = explode(';', $this->config->host); // Could be multiple hosts
foreach ($hosts as $host) { // Try each host in turn
$host = trim($host);
View
2 auth/shibboleth/README.txt
@@ -212,7 +212,7 @@ Example file:
// We want to split this up to get:
// institution, street, zipcode, city and country
$address = $_SERVER[$this->config->field_map_address];
- list($institution, $street, $zip_city) = split('\$', $address);
+ list($institution, $street, $zip_city) = explode('$', $address);
ereg(' (.+)',$zip_city, $regs);
$city = $regs[1];
View
8 auth/shibboleth/auth.php
@@ -319,7 +319,7 @@ function process_config($config) {
* @param string $string Possibly multi-valued attribute from Shibboleth
*/
function get_first_string($string) {
- $list = split( ';', $string);
+ $list = explode( ';', $string);
$clean_string = rtrim($list[0]);
return $clean_string;
@@ -384,10 +384,10 @@ function print_idp_list(){
function get_idp_list($organization_selection) {
$idp_list = array();
- $idp_raw_list = split("\n", $organization_selection);
+ $idp_raw_list = explode("\n", $organization_selection);
foreach ($idp_raw_list as $idp_line){
- $idp_data = split(',', $idp_line);
+ $idp_data = explode(',', $idp_line);
if (isset($idp_data[2]))
{
$idp_list[trim($idp_data[0])] = array(trim($idp_data[1]),trim($idp_data[2]));
@@ -410,7 +410,7 @@ function get_idp_list($organization_selection) {
function generate_cookie_array($value) {
// Decodes and splits cookie value
- $CookieArray = split(' ', $value);
+ $CookieArray = explode(' ', $value);
$CookieArray = array_map('base64_decode', $CookieArray);
return $CookieArray;
View
2 lib/componentlib.class.php
@@ -486,7 +486,7 @@ function get_all_components_md5() {
$lines=preg_split('/\r?\n/',$contents);
/// Each line will be one component
foreach($lines as $line) {
- $availablecomponents[] = split(',', $line);
+ $availablecomponents[] = explode(',', $line);
}
/// If no components have been found, return error
if (empty($availablecomponents)) {
View
2 lib/datalib.php
@@ -598,7 +598,7 @@ function get_courses_wmanagers($categoryid=0, $sort="c.sortorder ASC", $fields=a
return $courses;
}
- $managerroles = split(',', $CFG->coursecontact);
+ $managerroles = explode(',', $CFG->coursecontact);
$catctxids = '';
if (count($managerroles)) {
if ($allcats === true) {
View
2 lib/form/selectgroups.php
@@ -101,7 +101,7 @@ function MoodleQuickForm_selectgroups($elementName=null, $elementLabel=null, $op
function setSelected($values)
{
if (is_string($values) && $this->getMultiple()) {
- $values = split("[ ]?,[ ]?", $values);
+ $values = preg_split("/[ ]?,[ ]?/", $values);
}
if (is_array($values)) {
$this->_values = array_values($values);
View
2 lib/memcached.class.php
@@ -51,7 +51,7 @@ function memcached() {
}
$this->_cache = new Memcache;
- $hosts = split(',', $CFG->memcachedhosts);
+ $hosts = explode(',', $CFG->memcachedhosts);
if (count($hosts) === 1 && !empty($CFG->memcachedpconn)) {
// the faster pconnect is only available
// for single-server setups
View
2 lib/moodlelib.php
@@ -6442,7 +6442,7 @@ function get_string($identifier, $component = '', $a = NULL) {
if (strpos($component, '/') !== false) {
debugging('The module name you passed to get_string is the deprecated format ' .
'like mod/mymod or block/myblock. The correct form looks like mymod, or block_myblock.' , DEBUG_DEVELOPER);
- $componentpath = split('/', $component);
+ $componentpath = explode('/', $component);
switch ($componentpath[0]) {
case 'mod':
View
2 webservice/amf/locallib.php
@@ -64,7 +64,7 @@ protected function service_class_method_body($function, $params){
//cast the param from object to array (validate_parameters except array only)
$castingcode = '';
if ($params){
- $paramstocast = split(',', $params);
+ $paramstocast = explode(',', $params);
foreach ($paramstocast as $paramtocast) {
$paramtocast = trim($paramtocast);
$castingcode .= $paramtocast .
View
2 webservice/lib.php
@@ -730,7 +730,7 @@ protected function service_class_method_body($function, $params){
//cast the param from object to array (validate_parameters except array only)
$castingcode = '';
if ($params){
- $paramstocast = split(',', $params);
+ $paramstocast = explode(',', $params);
foreach ($paramstocast as $paramtocast) {
//clean the parameter from any white space
$paramtocast = trim($paramtocast);

0 comments on commit 7785dc2

Please sign in to comment.
Something went wrong with that request. Please try again.