original_string: protected function decode_remote_request($request) {
  
          $data = base64_decode($request, true);
  
          if ($data === false) {
              return false;
          }
  
          $data = json_decode($data);
  
          if (is_null($data)) {
              return false;
          }
  
          if (!isset($data->name) or !isset($data->component) or !isset($data->version)) {
              return false;
          }
  
          $data->name = s(strip_tags($data->name));
  
          if ($data->component !== clean_param($data->component, PARAM_COMPONENT)) {
              return false;
          }
  
          list($plugintype, $pluginname) = core_component::normalize_component($data->component);
  
          if ($plugintype === 'core') {
              return false;
          }
  
          if ($data->component !== $plugintype.'_'.$pluginname) {
              return false;
          }
  
          if (!core_component::is_valid_plugin_name($plugintype, $pluginname)) {
              return false;
          }
  
          $plugintypes = core_component::get_plugin_types();
          if (!isset($plugintypes[$plugintype])) {
              return false;
          }
  
          // Keep this regex in sync with the one used by the download.moodle.org/api/x.y/pluginfo.php
          if (!preg_match('/^[0-9]+$/', $data->version)) {
              return false;
          }
  
          return $data;
      }
code: protected function decode_remote_request($request) {
  
          $data = base64_decode($request, true);
  
          if ($data === false) {
              return false;
          }
  
          $data = json_decode($data);
  
          if (is_null($data)) {
              return false;
          }
  
          if (!isset($data->name) or !isset($data->component) or !isset($data->version)) {
              return false;
          }
  
          $data->name = s(strip_tags($data->name));
  
          if ($data->component !== clean_param($data->component, PARAM_COMPONENT)) {
              return false;
          }
  
          list($plugintype, $pluginname) = core_component::normalize_component($data->component);
  
          if ($plugintype === 'core') {
              return false;
          }
  
          if ($data->component !== $plugintype.'_'.$pluginname) {
              return false;
          }
  
          if (!core_component::is_valid_plugin_name($plugintype, $pluginname)) {
              return false;
          }
  
          $plugintypes = core_component::get_plugin_types();
          if (!isset($plugintypes[$plugintype])) {
              return false;
          }
  
          // Keep this regex in sync with the one used by the download.moodle.org/api/x.y/pluginfo.php
          if (!preg_match('/^[0-9]+$/', $data->version)) {
              return false;
          }
  
          return $data;
      }
code_tokens: protected function decode_remote_request ( $ request ) { $ data = base64_decode ( $ request , true ) ; if ( $ data === false ) { return false ; } $ data = json_decode ( $ data ) ; if ( is_null ( $ data ) ) { return false ; } if ( ! isset ( $ data -> name ) or ! isset ( $ data -> component ) or ! isset ( $ data -> version ) ) { return false ; } $ data -> name = s ( strip_tags ( $ data -> name ) ) ; if ( $ data -> component !== clean_param ( $ data -> component , PARAM_COMPONENT ) ) { return false ; } list ( $ plugintype , $ pluginname ) = core_component :: normalize_component ( $ data -> component ) ; if ( $ plugintype === 'core' ) { return false ; } if ( $ data -> component !== $ plugintype . '_' . $ pluginname ) { return false ; } if ( ! core_component :: is_valid_plugin_name ( $ plugintype , $ pluginname ) ) { return false ; } $ plugintypes = core_component :: get_plugin_types ( ) ; if ( ! isset ( $ plugintypes [ $ plugintype ] ) ) { return false ; } // Keep this regex in sync with the one used by the download.moodle.org/api/x.y/pluginfo.php if ( ! preg_match ( '/^[0-9]+$/' , $ data -> version ) ) { return false ; } return $ data ; }
docstring: Decode the request from the Moodle Plugins directory
  
  @param string $request submitted via 'installaddonrequest' HTTP parameter
  @return stdClass|bool false on error, object otherwise
docstring_tokens: Decode the request from the Moodle Plugins directory