@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | * \brief Page to make a Dolibarr online upgrade |
| 23 | 23 | */ |
| 24 | 24 | |
| 25 | -if (! defined('CSRFCHECK_WITH_TOKEN')) { |
|
| 26 | - define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
| 25 | +if (!defined('CSRFCHECK_WITH_TOKEN')) { |
|
| 26 | + define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | // Load Dolibarr environment |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | libxml_disable_entity_loader(true); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - $sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); |
|
| 72 | + $sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET); |
|
| 73 | 73 | } else { |
| 74 | 74 | $sfurl = 'xml_not_available'; |
| 75 | 75 | } |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | libxml_disable_entity_loader(true); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - $sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); |
|
| 61 | + $sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET); |
|
| 62 | 62 | } else { |
| 63 | 63 | setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors'); |
| 64 | 64 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | if (GETPOST('target') == 'remote') { |
| 173 | - $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into api_setup.class.php. |
|
| 173 | + $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into api_setup.class.php. |
|
| 174 | 174 | |
| 175 | 175 | // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) |
| 176 | 176 | if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | libxml_disable_entity_loader(true); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - $xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); |
|
| 185 | + $xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET); |
|
| 186 | 186 | } else { |
| 187 | 187 | $errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg']; |
| 188 | 188 | setEventMessages($errormsg, null, 'errors'); |
@@ -36,12 +36,12 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | // Load Dolibarr environment |
| 38 | 38 | require '../../main.inc.php'; |
| 39 | -require_once DOL_DOCUMENT_ROOT.'/core/class/fileupload.class.php'; // Class to upload common files |
|
| 39 | +require_once DOL_DOCUMENT_ROOT.'/core/class/fileupload.class.php'; // Class to upload common files |
|
| 40 | 40 | require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; |
| 41 | 41 | require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; |
| 42 | 42 | |
| 43 | 43 | $id = GETPOST('fk_element', 'int'); |
| 44 | -$element = GETPOST('element', 'alpha'); // 'myobject' (myobject=mymodule) or 'myobject@mymodule' or 'myobject_mysubobject' (myobject=mymodule) |
|
| 44 | +$element = GETPOST('element', 'alpha'); // 'myobject' (myobject=mymodule) or 'myobject@mymodule' or 'myobject_mysubobject' (myobject=mymodule) |
|
| 45 | 45 | $elementupload = $element; |
| 46 | 46 | |
| 47 | 47 | // Load object according to $id and $element |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | if (!empty($user->socid)) { |
| 62 | 62 | $socid = $user->socid; |
| 63 | 63 | if (!empty($object->socid) && $socid != $object->socid) { |
| 64 | - httponly_accessforbidden("Access on object not allowed for this external user."); // This includes the exit. |
|
| 64 | + httponly_accessforbidden("Access on object not allowed for this external user."); // This includes the exit. |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | -$result = restrictedArea($user, $object->module, $object, $object->table_element, $usesublevelpermission, 'fk_soc', 'rowid', 0, 1); // Call with mode return |
|
| 68 | +$result = restrictedArea($user, $object->module, $object, $object->table_element, $usesublevelpermission, 'fk_soc', 'rowid', 0, 1); // Call with mode return |
|
| 69 | 69 | if (!$result) { |
| 70 | 70 | httponly_accessforbidden('Not allowed by restrictArea (module='.$object->module.' table_element='.$object->table_element.')'); |
| 71 | 71 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | ?> |
| 401 | 401 | <div class="center login_main_message"> |
| 402 | 402 | <?php |
| 403 | - $message = $_SESSION['dol_loginmesg']; // By default this is an error message |
|
| 403 | + $message = $_SESSION['dol_loginmesg']; // By default this is an error message |
|
| 404 | 404 | if (preg_match('/<!-- warning -->/', $message)) { // if it contains this comment, this is a warning message |
| 405 | 405 | $message = str_replace('<!-- warning -->', '', $message); |
| 406 | 406 | print '<div class="warning">'; |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | libxml_disable_entity_loader(true); |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | - $xml = simplexml_load_string($resgetcommitstrip['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET); |
|
| 431 | + $xml = simplexml_load_string($resgetcommitstrip['content'], 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET); |
|
| 432 | 432 | $little = $xml->channel->item[0]->children('content', true); |
| 433 | 433 | print preg_replace('/width="650" height="658"/', '', $little->encoded); |
| 434 | 434 | } |