Project

General

Profile

Defect #13138 » htmlentities_delete_r11398.diff

Jun NAITOH, 2013-02-15 13:25

View differences:

lib/plugins/rfpdf/init.rb (working copy)
1
begin
2
  require('htmlentities') 
3
rescue LoadError
4
  # This gem is not required - just nice to have.
5
end
6 1
require('cgi')
7 2
require 'rfpdf'
8 3

  
lib/plugins/rfpdf/lib/tcpdf.rb (working copy)
94 94
  cattr_accessor :k_path_url_cache
95 95
  @@k_path_url_cache = Rails.root.join('tmp')
96 96
  
97
  cattr_accessor :decoder
98
		
99 97
	attr_accessor :barcode
100 98
	
101 99
	attr_accessor :buffer
......
223 221
		#Some checks
224 222
		dochecks();
225 223
		
226
		begin	  
227
		  @@decoder = HTMLEntities.new 
228
		rescue
229
		  @@decoder = nil
230
		end
231
		
232 224
		#Initialization of properties
233 225
  	@barcode ||= false
234 226
		@buffer ||= ''
......
4344 4336
	# @return string converted
4345 4337
	#
4346 4338
	def unhtmlentities(string)
4347
	  if @@decoder.nil?
4348 4339
      CGI.unescapeHTML(string)
4349
    else
4350
  	  @@decoder.decode(string)
4351
    end
4352 4340
  end
4353 4341
  
4354 4342
end # END OF CLASS
lib/plugins/rfpdf/README (working copy)
10 10
==
11 11
==
12 12

  
13
If you are using HTML, it is recommended you install:
14

  
15
gem install -r htmlentities
16

  
17 13
TCPDF Documentation located at:
18 14

  
19 15
http://phpdocs.moodle.org/com-tecnick-tcpdf/TCPDF.html
......
42 38

  
43 39
  pdf = TCPDF.new
44 40

  
45
ENJOY!
41
ENJOY!
(2-2/2)