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
It would be better to place all the entries coming from the META tags, with an absolute URL. #651
Comments
In the ./lib/Controller.php we can found the VERSION value 1.3.4 In the tpl, we can use it : Then, we can add a value in the ./lib/Controller.php for add a HOST_VALUE and use it. On the other hand, it would be better to be able to use the configuration file, because, I suppose that the administrator does not want to configure several files. |
So would this really solve all the OpenGraph-related issues you've linked? But if it helps, we would be happy to appreciate a PR. |
What is a PR? (OLD) privatebin.visionduweb.fr Would it be a problem of chmod / chown, which prevents access if the url is relative in fact that I do not know. In my case, I modified the code in the template myself. As indicated in the open message, to correct this problem, you would have to create a configuration variable, to be able to enter your domain name, and, that this variable be used in the template. On the other hand, I identified the way of doing it, if the variable domain is present in the library file ./lib/Controller.php as I indicated, since it seems that it is this file which informs about the value 1.3 .4 which is used in the template, following the images. I have not tested here but I wonder if we fill in "localhost" if it could work, but, in fact, no I don't think so, because the absolute url would then be localhost / image.ext and I suppose that l will not be found, since Twitter or Facebook will request from outside, to localhost / image.ext So, in my opinion, the only way is to be able to clearly indicate the domain name used. The best for user comfort, is to know how to add such a variable in the configuration file, rather than in the library file, otherwise, two files are to be filled in, and, we get lost in the configuration (for the administrator from the server.) The removal of version 1.3.4 does not seem necessary, contrary to what I thought, thus, the PHP tags can remain in place behind the image. On the other hand, it seems that Facebook does not like that, when checking the opengraph validity of the image, but, it works. https://developers.facebook.com/tools/debug/?q=https%3A%2F%2Fprivatebin.lecannabiste.com It even seems that Facebook no longer mentions the alert for 1.3.4, so it would seem that this alert was more an alert related to the missing domain name, therefore, a relative URL that facebook could not match . Thus, the answer to the opengraph problem is to define an absolute URL, with HTTP / HTTPS ... |
For information on how to propose PRs, see https://help.github.com/articles/proposing-changes-to-your-work-with-pull-requests/. See this article for how to merge upstream changes into your fork. This way, you can propose us changes you want to contribute to this project (called "upstream"). |
Sorry, Pull Request * OK. Yes, I have already done a PR for the language. But, for this URL problem, as I said, the best would be to be able to use the configuration file, to indicate the domain name, but, I don't know how, to use the variable of the configuration file in the PHP code of the template. On the other hand, it is possible to get around my lack of knowledge, by using the library file, to indicate the domain name there, but, I find it much less comfortable for the administrator, who will have to modify 2 configuration files at place of one. Another solution would then be to comment out the Opengraph code, since it does not work, and then to indicate in the comment that it is necessary to indicate an absolute URL for the image ... |
This may help you: https://github.com/PrivateBin/PrivateBin/wiki/Development#creating-new-configuration-options |
Thank you for the link, well in fact, I do not make an object, so little, that, your resource did not help me at all, on the contrary: / Finally, I did a search on the keyword notice, which is not very present, to see how to steal his behavior. I don't know if I'm using the best way, since notice is text, and in my case it's a URL. (which could be filtered, in the best of cases, but hey, the administrator is supposed to have correctly filled in his own URL, and, doing a test during the production.) sudo nano PrivateBin/lib/Configuration.php
sudo nano PrivateBin/lib/Controller.php
sudo nano PrivateBin/cfg/conf.sample.php
sudo nano PrivateBin/tpl/bootstrap.php
Thus, I manage to write the variable. Thank you. |
Looks good, maybe rename it to "path" or so and explain in the config that this only applies to the meta tags, but except of that it looks good. |
Ok. I look. |
Test OK. I up to my repo and send a PR : #664 |
Make Opengraph really functional Change : PrivateBin#664 for PrivateBin#651
I add the line with BASEPATH in tst/ViewTest.php
|
Note, i can't use ", PHP_EOL" otherwise, the rest of the code is returned on a new line. So I simply removed ", PHP_EOL" without certainty on the correct syntax to use in the rules of art. It works that way : sudo nano PrivateBin/tpl/bootstrap.php Then i can write the domain in the bootstrap.php file : |
We use that pattern in the templates because PHP tries to be clever and removes the line feed characters after you end a PHP block with In your case, where you want to output your variable in the same line as the path to the image, it is correct to not add that constant. |
Nah, let's only close this when the PR to fix this is merged. You can (automatically) let issues close when a PR is merged by adding some "magic" text to your PR body, so manually closing is not needed. |
UP - Last version from Privatebin, from Github, today. Opengraph doesn't work ! https://privatebin.monnaie-libre.fr URL is not with absolute path. Making too good PHP code ... Makes it not work. |
Perhaps it would be better to place all the entries coming from the META tags, with an absolute URL.
Thus, it would be necessary to add a variable, from the configuration file, which would be used to enter the domain name, and, thus, write the absolute URL address, in the files called from the META tags (images, files, css, js , json ...)
In this two files :
Important ! This issue was closed, but, only if this new issue #651 was resolved !
#646 ( See for documentation. )
#645
#644
The text was updated successfully, but these errors were encountered: