Skip to content

Commit

Permalink
Really don't use globals
Browse files Browse the repository at this point in the history
  • Loading branch information
narfbg committed Feb 24, 2014
1 parent c26b9eb commit 20e802e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
3 changes: 1 addition & 2 deletions system/helpers/typography_helper.php
Expand Up @@ -88,8 +88,7 @@ function auto_typography($str, $reduce_linebreaks = FALSE)
*/
function entity_decode($str, $charset = NULL)
{
global $SEC;
return $SEC->entity_decode($str, $charset);
return get_instance()->security->entity_decode($str, $charset);
}
}

Expand Down
22 changes: 12 additions & 10 deletions system/libraries/Xmlrpcs.php
Expand Up @@ -203,15 +203,17 @@ public function add_to_map($methodname, $function, $sig, $doc)
*/
public function parseRequest($data = '')
{
global $HTTP_RAW_POST_DATA;

//-------------------------------------
// Get Data
//-------------------------------------

if ($data === '')
{
$data = $HTTP_RAW_POST_DATA;
$CI =& get_instance();
if ($CI->input->method() === 'post')
{
$data = http_build_query($CI->input->input_stream(NULL, FALSE));
}
}

//-------------------------------------
Expand All @@ -222,13 +224,13 @@ public function parseRequest($data = '')
$parser_object = new XML_RPC_Message('filler');

$parser_object->xh[$parser] = array(
'isf' => 0,
'isf_reason' => '',
'params' => array(),
'stack' => array(),
'valuestack' => array(),
'method' => ''
);
'isf' => 0,
'isf_reason' => '',
'params' => array(),
'stack' => array(),
'valuestack' => array(),
'method' => ''
);

xml_set_object($parser, $parser_object);
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, TRUE);
Expand Down
1 change: 1 addition & 0 deletions user_guide_src/source/changelog.rst
Expand Up @@ -726,6 +726,7 @@ Bug fixes for 3.0
- Fixed a bug where :doc:`HTML Table Library <libraries/table>` ignored its *auto_heading* setting if headings were not already set.
- Fixed a bug (#2364) - :doc:`Pagination Library <libraries/pagination>` appended the query string (if used) multiple times when there are successive calls to ``create_links()`` with no ``initialize()`` in between them.
- Partially fixed a bug (#261) - UTF-8 class method ``clean_string()`` generating log messages and/or not producing the desired result due to an upstream bug in iconv.
- Fixed a bug where ``CI_Xmlrpcs::parseRequest()`` could fail if ``$HTTP_RAW_POST_DATA`` is not populated.

Version 2.1.4
=============
Expand Down

0 comments on commit 20e802e

Please sign in to comment.