Skip to content

Fix PHP notice in Jetpack_PostImages::from_attachment method#418

Merged
samhotchkiss merged 1 commit into
Automattic:masterfrom
rowatt:fix-jetpack-post-images-notice
Jan 22, 2015
Merged

Fix PHP notice in Jetpack_PostImages::from_attachment method#418
samhotchkiss merged 1 commit into
Automattic:masterfrom
rowatt:fix-jetpack-post-images-notice

Conversation

@rowatt
Copy link
Copy Markdown

@rowatt rowatt commented Mar 24, 2014

Add logic to cope with images in posts with protocol independent and root relative urls. The URLs returned are always absolute, using WP_HOME if the image src in the post was a root relative URL. This method is used by the Jetpack OpenGraph functions, and the og:image property should be absolute (apparently... though the documentation does not seem to explicitly state this).

Add a logic to cope with images in posts with protocol independent and root relative urls
@richardmtl
Copy link
Copy Markdown
Contributor

@georgestephanis georgestephanis added ready Bug When a feature is broken and / or not performing as intended and removed Enhancement Changes to an existing feature — removing, adding, or changing parts of it labels Oct 9, 2014
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably shouldn't use the constant here, it would likely be better to use something derived from either site_url() or home_url() -- as this will cause issues if WordPress is installed in a subdirectory, you'll need to strip off any path component to them. Or potentially just pull from the $_SERVER superglobal to find out the host?

@jeherve
Copy link
Copy Markdown
Member

jeherve commented Jan 18, 2015

@rowatt Have you had the chance to review George's comments above?

@rowatt
Copy link
Copy Markdown
Author

rowatt commented Jan 22, 2015

Sorry - I missed the comments originally. I'm afraid I'm not in a position to work on this now, sorry.

@jeherve jeherve modified the milestones: vFuture, 3.4 Jan 22, 2015
@samhotchkiss samhotchkiss merged commit 8a1d3ac into Automattic:master Jan 22, 2015
@samhotchkiss
Copy link
Copy Markdown
Contributor

There were just a couple minor changes needed, so I went ahead and took care of them for you, @rowatt -- it'll be in 3.4!

@samhotchkiss samhotchkiss modified the milestones: 3.4, vFuture Jan 22, 2015
@rowatt
Copy link
Copy Markdown
Author

rowatt commented Jan 22, 2015

That's great - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug When a feature is broken and / or not performing as intended General

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants