New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move oembed to src #4156
Move oembed to src #4156
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you had tested it on your side for some time?
There are only minor issues that I found.
src/Content/OEmbed.php
Outdated
<?php | ||
|
||
/* | ||
* To change this license header, choose License Headers in Project Properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines confusing me. Are these place holders?
Additionally @file
is missing.
src/Content/OEmbed.php
Outdated
require_once 'mod/proxy.php'; | ||
|
||
/** | ||
* Description of OEmbed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little bit too generic, I think.
src/Content/OEmbed.php
Outdated
public static function replaceCallback($matches) | ||
{ | ||
$embedurl = $matches[1]; | ||
$j = OEmbed::fetchURL($embedurl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't self::
be better here? (Same goes for the line below and much other places)
src/Content/OEmbed.php
Outdated
private static function buildXPath($attr, $value) | ||
{ | ||
// https://www.westhoffswelt.de/blog/2009/6/9/select-html-elements-with-more-than-one-css-class-using-xpath | ||
return "contains( normalize-space( @$attr ), ' $value ' ) or substring( normalize-space( @$attr ), 1, string-length( '$value' ) + 1 ) = '$value ' or substring( normalize-space( @$attr ), string-length( @$attr ) - string-length( '$value' ) ) = ' $value' or @$attr = '$value'"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several spaces in that line that could be removed to make it look better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some spaces are required are it is looking for a value in a space-separated list, but there are a several others I can indeed remove.
- Add file comment in Content\OEmbed - Add self where relevant - Remove useless spaces from the XPath expression
Related to #4155
Part of #3878
Part of #4090
This is just a preparation for the work that hopefully will be agreed upon in #4155