Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
FreshRSS-Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christophe Henry
FreshRSS-Android
Commits
225ca4b9
Commit
225ca4b9
authored
Feb 21, 2020
by
Christophe Henry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix question mark, slashes and other characters being replaced by full-witdh forms
parent
5c8e414b
Pipeline
#3596
passed with stage
in 0 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
19 deletions
+18
-19
app/src/main/java/fr/chenry/android/freshrss/components/subscriptionarticles/webviewutils/ShareIntent.kt
...mponents/subscriptionarticles/webviewutils/ShareIntent.kt
+2
-6
app/src/main/java/fr/chenry/android/freshrss/store/api/models/SubscriptionApiItem.kt
.../android/freshrss/store/api/models/SubscriptionApiItem.kt
+2
-2
app/src/main/java/fr/chenry/android/freshrss/store/database/Converters.kt
...a/fr/chenry/android/freshrss/store/database/Converters.kt
+2
-2
app/src/main/java/fr/chenry/android/freshrss/store/database/FreshRSSDabatabase.kt
...nry/android/freshrss/store/database/FreshRSSDabatabase.kt
+3
-3
app/src/main/java/fr/chenry/android/freshrss/utils/KotlinExtensions.kt
...java/fr/chenry/android/freshrss/utils/KotlinExtensions.kt
+9
-3
app/src/main/res/values-ar/strings.xml
app/src/main/res/values-ar/strings.xml
+0
-1
app/src/main/res/values-fr/strings.xml
app/src/main/res/values-fr/strings.xml
+0
-1
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+0
-1
No files found.
app/src/main/java/fr/chenry/android/freshrss/components/subscriptionarticles/webviewutils/ShareIntent.kt
View file @
225ca4b9
package
fr.chenry.android.freshrss.components.subscriptionarticles.webviewutils
import
android.content.Intent
import
android.content.Intent.*
import
android.content.Intent.ACTION_SEND
import
android.content.Intent.EXTRA_TEXT
import
com.x5.template.Theme
import
fr.chenry.android.freshrss.F
import
fr.chenry.android.freshrss.R
import
fr.chenry.android.freshrss.components.subscriptionarticles.webviewutils.chunkfilters.SentenceCapFilter
import
fr.chenry.android.freshrss.components.subscriptionarticles.webviewutils.chunkfilters.StripFragmentFilter
import
fr.chenry.android.freshrss.utils.nullIfBlank
object
ShareIntent
{
private
val
defaultTemplate
=
"""
...
...
@@ -29,7 +27,5 @@ object ShareIntent {
fun
create
(
attributes
:
Map
<
String
,
String
>)
=
Intent
(
ACTION_SEND
).
apply
{
type
=
"text/plain"
putExtra
(
EXTRA_TEXT
,
format
(
attributes
))
val
feedName
=
attributes
[
"subscription"
]
?.
nullIfBlank
()
?:
F
.
getString
(
R
.
string
.
this
_feed
)
putExtra
(
EXTRA_SUBJECT
,
F
.
getString
(
R
.
string
.
share_article
,
feedName
))
}
}
app/src/main/java/fr/chenry/android/freshrss/store/api/models/SubscriptionApiItem.kt
View file @
225ca4b9
...
...
@@ -4,7 +4,7 @@ import com.fasterxml.jackson.core.JsonParser
import
com.fasterxml.jackson.databind.DeserializationContext
import
com.fasterxml.jackson.databind.annotation.JsonDeserialize
import
com.fasterxml.jackson.databind.deser.std.StringDeserializer
import
fr.chenry.android.freshrss.utils.unescape
Html4
import
fr.chenry.android.freshrss.utils.unescape
typealias
StreamId
=
String
...
...
@@ -26,5 +26,5 @@ data class SubscriptionCategoryApiItem(
)
class
HtmlEntitiesDeserializer
:
StringDeserializer
()
{
override
fun
deserialize
(
p
:
JsonParser
?,
ctxt
:
DeserializationContext
?)
=
super
.
deserialize
(
p
,
ctxt
).
unescape
Html4
()
override
fun
deserialize
(
p
:
JsonParser
?,
ctxt
:
DeserializationContext
?)
=
super
.
deserialize
(
p
,
ctxt
).
unescape
()
}
app/src/main/java/fr/chenry/android/freshrss/store/database/Converters.kt
View file @
225ca4b9
...
...
@@ -22,10 +22,10 @@ class Converters {
fun
readStatusToString
(
liveData
:
ReadStatus
)
=
liveData
.
name
@TypeConverter
fun
listOfStringToString
(
list
:
List
<
String
>)
=
list
.
map
{
it
.
escape
Html4
()
}.
joinToString
(
" "
)
fun
listOfStringToString
(
list
:
List
<
String
>)
=
list
.
map
{
it
.
escape
()
}.
joinToString
(
" "
)
@TypeConverter
fun
stringToListOfString
(
string
:
String
)
=
string
.
split
(
"\\s+"
.
toRegex
()).
map
{
it
.
unescape
Html4
()
}
fun
stringToListOfString
(
string
:
String
)
=
string
.
split
(
"\\s+"
.
toRegex
()).
map
{
it
.
unescape
()
}
@TypeConverter
fun
bitmapToBlob
(
bitmap
:
Bitmap
?)
=
...
...
app/src/main/java/fr/chenry/android/freshrss/store/database/FreshRSSDabatabase.kt
View file @
225ca4b9
...
...
@@ -6,7 +6,7 @@ import dev.matrix.roomigrant.GenerateRoomMigrations
import
fr.chenry.android.freshrss.store.api.models.StreamId
import
fr.chenry.android.freshrss.store.database.models.*
import
fr.chenry.android.freshrss.utils.Try
import
fr.chenry.android.freshrss.utils.escape
Html4
import
fr.chenry.android.freshrss.utils.escape
import
kotlinx.coroutines.*
import
org.joda.time.LocalDateTime
...
...
@@ -67,9 +67,9 @@ abstract class FreshRSSDabatabase : RoomDatabase() {
fun
insertSubscriptionImage
(
id
:
String
,
bitmap
:
Bitmap
)
=
getSubscriptionsDAO
().
insertImage
(
id
,
bitmap
)
fun
getSubcriptionsById
(
id
:
String
)
=
getSubscriptionsDAO
().
byId
(
id
)
fun
getSubcriptionsBySubscriptionCategory
(
subscriptionCategory
:
SubscriptionCategory
)
=
getSubscriptionsDAO
().
bySubscriptionCategory
(
"%${subscriptionCategory.id.escape
Html4
()}%"
)
getSubscriptionsDAO
().
bySubscriptionCategory
(
"%${subscriptionCategory.id.escape()}%"
)
fun
getSubcriptionsBySubscriptionCategoryAndUnreadCount
(
subscriptionCategory
:
SubscriptionCategory
)
=
getSubscriptionsDAO
().
bySubscriptionCategoryAndUnreadCount
(
"%${subscriptionCategory.id.escape
Html4
()}%"
)
getSubscriptionsDAO
().
bySubscriptionCategoryAndUnreadCount
(
"%${subscriptionCategory.id.escape()}%"
)
fun
getAllSubcriptions
()
=
getSubscriptionsDAO
().
getAll
()
fun
getAllUnreadSubcriptions
()
=
getSubscriptionsDAO
().
getAllUnread
()
suspend
fun
getAllSubcriptionsIds
()
=
getSubscriptionsDAO
().
getAllIds
()
...
...
app/src/main/java/fr/chenry/android/freshrss/utils/KotlinExtensions.kt
View file @
225ca4b9
...
...
@@ -75,7 +75,7 @@ fun Request.authentify(account: Account) =
fun
Request
.
authorize
(
account
:
Account
)
=
this
.
header
(
"T"
to
account
.
writeToken
)
fun
Any
?.
unit
()
:
Unit
=
Unit
fun
Any
?.
unit
()
=
Unit
fun
Any
.
v
(
message
:
String
)
=
Log
.
v
(
this
::
class
.
qualifiedName
,
message
).
unit
()
fun
Any
.
v
(
message
:
Throwable
)
=
Log
.
v
(
this
::
class
.
qualifiedName
,
"VERBOSE"
,
message
).
unit
()
fun
Any
.
d
(
message
:
String
)
=
Log
.
d
(
this
::
class
.
qualifiedName
,
message
).
unit
()
...
...
@@ -91,8 +91,14 @@ fun Any.wtf(message: Throwable) = Log.wtf(this::class.qualifiedName, "WTF", mess
fun
String
.
addTrailingSlash
()
=
if
(
this
.
endsWith
(
"/"
))
this
else
"$this/"
fun
String
.
removeNewLines
()
=
this
.
replace
(
"\\s+"
.
toRegex
(),
" "
)
fun
String
.
escapeHtml4
()
=
StringEscapeUtils
.
escapeHtml4
(
this
).
orEmpty
()
fun
String
.
unescapeHtml4
()
=
StringEscapeUtils
.
unescapeHtml4
(
this
).
orEmpty
()
fun
String
.
escape
()
=
StringEscapeUtils
.
escapeHtml4
(
this
).
orEmpty
()
// See https://github.com/FreshRSS/FreshRSS/issues/2770#issuecomment-575208803
fun
String
?.
unescape
()
=
StringEscapeUtils
.
unescapeHtml4
(
this
).
orEmpty
().
let
{
s-
>
var
res
=
s
listOf
(
'’'
to
'\''
,
'"'
to
'"'
,
'^'
to
'^'
,
'?'
to
'?'
,
'\'
to
'\\'
,
'/'
to
'/'
,
','
to
','
,
';'
to
';'
)
.
forEach
{
res
=
res
.
replace
(
it
.
first
,
it
.
second
)}
res
}
fun
String
?.
nullIfBlank
()
=
if
(
this
.
isNullOrBlank
())
null
else
this
fun
String
?.
extractURLs
():
List
<
Uri
>
=
if
(
this
.
isNullOrBlank
())
listOf
()
else
{
this
...
...
app/src/main/res/values-ar/strings.xml
View file @
225ca4b9
...
...
@@ -35,7 +35,6 @@
<string
name=
"refresh_frequency_30m"
>
30 دقيقة
</string>
<string
name=
"title_settings"
>
الإعدادات
</string>
<string
name=
"nav_header_subtitle"
>
القائمة
</string>
<string
name=
"this_feed"
>
هذا التدفق
</string>
<string
name=
"subscription_categories"
>
الفئات
</string>
<string
name=
"good_evening_user"
>
عمّ مساؤك %s
</string>
<string
name=
"good_morning_user"
>
أسعدت صباحًا %s
</string>
...
...
app/src/main/res/values-fr/strings.xml
View file @
225ca4b9
...
...
@@ -27,7 +27,6 @@
<string
name=
"title_unread"
>
Non lus
</string>
<string
name=
"unread"
>
non lu
</string>
<string
name=
"title_favorites"
>
Favoris
</string>
<string
name=
"this_feed"
>
ce flux
</string>
<string
name=
"read"
>
lu
</string>
<string
name=
"prompt_login"
>
Identifiant
</string>
<string
name=
"error_instance"
>
Cette URL n\'est pas correcte
</string>
...
...
app/src/main/res/values/strings.xml
View file @
225ca4b9
...
...
@@ -94,7 +94,6 @@
<string
name=
"good_evening_user"
>
Good evening%s
</string>
<string
name=
"subscription_categories"
>
Categories
</string>
<string
name=
"share_article"
>
Share article of %s
</string>
<string
name=
"this_feed"
>
this feed
</string>
<string
name=
"instance_url_malformed"
>
This URL is malformed
</string>
<string
name=
"no_internet_connection_avaible"
>
There is no internet connection avaible for now, please retry later
</string>
<!-- Other messages -->
...
...
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