Skip to content

Commit ecbb779

Browse files
wpmobilebotjkmasselcrazytonyli
authored
Merge release/26.4.1 into trunk (#24990)
* Bump version number * Fix broken reader YouTube embeds * Fix reader related posts (#24986) * Bump version number --------- Co-authored-by: Jeremy Massel <[email protected]> Co-authored-by: Tony Li <[email protected]>
1 parent 7c7e831 commit ecbb779

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,11 @@ class ReaderDetailViewController: UIViewController, ReaderDetailView {
844844

845845
let controller = ReaderDetailViewController.loadFromStoryboard()
846846
let coordinator = ReaderDetailCoordinator(view: controller)
847-
coordinator.postURL = url
847+
coordinator.set(
848+
postID: NSNumber(value: simplePost.postID),
849+
siteID: NSNumber(value: simplePost.siteID),
850+
isFeed: false
851+
)
848852
coordinator.remoteSimplePost = simplePost
849853
controller.coordinator = coordinator
850854

WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ class ReaderWebView: WKWebView {
1313
/// From: https://www.w3schools.com/tags/att_src.asp
1414
private let elements = ["audio", "embed", "iframe", "img", "input", "script", "source", "track", "video"]
1515

16+
/// Google recently started requiring an HTTP referrer, otherwise it'll just show an error.
17+
///
18+
/// We'll set the referrer to https://wordpress.com/reader since that's what Google would get if the user were using WordPress.com. If needed, we
19+
/// could also set this to the specific site, which might be valuable for content owners to get more accurate information (they could see that example.com
20+
/// embedded the video, instead of just "some site that uses WordPress"). That's less ideal for privacy, so that's why we're starting here.
21+
///
22+
/// Documentation: https://developers.google.com/youtube/terms/required-minimum-functionality#set-the-referer
23+
/// See also: https://stackoverflow.com/q/79802987/496295
24+
private let baseURL = URL(string: "https://wordpress.com/reader")!
25+
1626
let jsToRemoveSrcSet = "document.querySelectorAll('img, img-placeholder').forEach((el) => {el.removeAttribute('srcset')})"
1727

1828
var postURL: URL? = nil
@@ -47,7 +57,7 @@ class ReaderWebView: WKWebView {
4757

4858
let content = formattedContent(addPlaceholder(string), additionalJavaScript: additionalJavaScript)
4959

50-
super.loadHTMLString(content, baseURL: Bundle.wordPressSharedBundle.bundleURL)
60+
super.loadHTMLString(content, baseURL: baseURL)
5161
}
5262

5363
/// Given a HTML content, returns it formatted.

config/Version.public.xcconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION_LONG = 26.4.0.3
2-
VERSION_SHORT = 26.4
1+
VERSION_LONG = 26.4.1.1
2+
VERSION_SHORT = 26.4.1

0 commit comments

Comments
 (0)