~canonical-sysadmins/wordpress/4.7.1

« back to all changes in this revision

Viewing changes to wp-includes/ID3/getid3.lib.php

  • Committer: Ryan Finnie
  • Date: 2015-08-31 16:09:47 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: ryan.finnie@canonical.com-20150831160947-1h6rfxby9z1ec62u
Merge WP4.3 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
519
519
        }
520
520
 
521
521
        public static function XML2array($XMLstring) {
522
 
                if ( function_exists( 'simplexml_load_string' ) && function_exists( 'libxml_disable_entity_loader' ) ) {
523
 
                        $loader = libxml_disable_entity_loader( true );
524
 
                        $XMLobject = simplexml_load_string( $XMLstring, 'SimpleXMLElement', LIBXML_NOENT );
525
 
                        $return = self::SimpleXMLelement2array( $XMLobject );
526
 
                        libxml_disable_entity_loader( $loader );
 
522
                if (function_exists('simplexml_load_string') && function_exists('libxml_disable_entity_loader')) {
 
523
                        // http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html
 
524
                        // https://core.trac.wordpress.org/changeset/29378
 
525
                        $loader = libxml_disable_entity_loader(true);
 
526
                        $XMLobject = simplexml_load_string($XMLstring, 'SimpleXMLElement', LIBXML_NOENT);
 
527
                        $return = self::SimpleXMLelement2array($XMLobject);
 
528
                        libxml_disable_entity_loader($loader);
527
529
                        return $return;
528
530
                }
529
531
                return false;
1163
1165
                                fwrite($tmp, $imgData);
1164
1166
                                fclose($tmp);
1165
1167
                                $GetDataImageSize = @getimagesize($tempfilename, $imageinfo);
 
1168
                                $GetDataImageSize['height'] = $GetDataImageSize[0];
 
1169
                                $GetDataImageSize['width']  = $GetDataImageSize[1];
1166
1170
                        }
1167
1171
                        unlink($tempfilename);
1168
1172
                }
1373
1377
                return substr(basename('X'.$splited[count($splited) - 1], $suffix), 1);
1374
1378
        }
1375
1379
 
1376
 
}
 
 
b'\\ No newline at end of file'
 
1380
}