Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
d132d9d7
Commit
d132d9d7
authored
Sep 25, 2014
by
Eloy Durán
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2497 from martincik/master
Sanitizing Plist UTF8 strings #2482
parents
d90c9545
5873251f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
6 deletions
+34
-6
CHANGELOG.md
CHANGELOG.md
+4
-0
plist.rb
lib/cocoapods/generator/acknowledgements/plist.rb
+30
-6
No files found.
CHANGELOG.md
View file @
d132d9d7
...
...
@@ -20,6 +20,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[
laiso
](
https://github.com/laiso
)
[
#2489
](
https://github.com/CocoaPods/CocoaPods/pull/2489
)
*
Fixes an issue where
`pod install`
would crash during Plist building if any
pod has invalid UTF-8 characters in their title or description.
[
Ladislav Martincik
](
https://github.com/martincik
)
[
#2482
](
https://github.com/CocoaPods/CocoaPods/issues/2482
)
## 0.34.0.rc2
...
...
lib/cocoapods/generator/acknowledgements/plist.rb
View file @
d132d9d7
...
...
@@ -36,8 +36,8 @@ module Pod
if
(
license
=
license_text
(
spec
))
{
:Type
=>
'PSGroupSpecifier'
,
:Title
=>
s
pec
.
name
,
:FooterText
=>
license
,
:Title
=>
s
anitize_encoding
(
spec
.
name
)
,
:FooterText
=>
sanitize_encoding
(
license
)
,
}
end
end
...
...
@@ -45,18 +45,42 @@ module Pod
def
header_hash
{
:Type
=>
'PSGroupSpecifier'
,
:Title
=>
header_title
,
:FooterText
=>
header_text
,
:Title
=>
sanitize_encoding
(
header_title
)
,
:FooterText
=>
sanitize_encoding
(
header_text
)
,
}
end
def
footnote_hash
{
:Type
=>
'PSGroupSpecifier'
,
:Title
=>
footnote_title
,
:FooterText
=>
footnote_text
,
:Title
=>
sanitize_encoding
(
footnote_title
)
,
:FooterText
=>
sanitize_encoding
(
footnote_text
)
,
}
end
#-----------------------------------------------------------------------#
private
# !@group Private methods
# Returns the sanitized text with UTF-8 eliminating invalid characters if
# Ruby version >=1.9 else will return the text.
#
# @param [String] text
# the text we want to sanitize.
#
# @return [String] The sanitized text if Ruby >=1.9 else text.
#
def
sanitize_encoding
(
text
)
if
RUBY_VERSION
>=
'1.9'
text
.
encode
(
'UTF-8'
,
'binary'
,
:invalid
=>
:replace
,
:undef
=>
:replace
,
:replace
=>
''
)
else
text
end
end
#-----------------------------------------------------------------------#
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment