1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Link Proxy Handling

Discussion in 'XenForo Questions and Support' started by Daniel-SP, Dec 18, 2014.

  1. Daniel-SP

    Daniel-SP Active Member

    Hello guys,

    I have read many topics regarding link proxy feature that XF recently implemented, I realized that its much likely related to security. Correct me if I'm wrong. I couldn't find any beter explanation regarding it and I have read some guys saying "if you don't know what is it, you don't need it". I personally don't agree with it since it can be something helpful.

    My question is: above all the common objectives of this feature, is that possible to handle the redirections with a addon, for example?

    Being a bit more detailed on what I'm saying, suppous Comprehensive URL Parser addon from @SneakyDave. This addon apply some rules in the URL whenever its posted by the user. My question is that if this proxy feature could help a similar addon to build some URL rules after its clicked.

    I have some requirements of a custom addon that I might need furtherly that would need and API connection to generate a custom link and it can't be prevented since the API generates a hash on the URL related to that specific link for that moment, with this, the API would respond a XML and one of those fields would be a new generated URL and then the user would be reditected to that new address.

    I don't know if I am clear enough. Let me know if there is something else to be explained.
     
  2. SneakyDave

    SneakyDave Well-Known Member

    That addon doesn't really have anything to do with the link proxy itself, it just supports links that are proxied by XenForo. Some addons, like that one, change the URL href via a bbcode or some other method, and as a result, need to have the href's data-proxy-href tag updated to match.

    This video explains the image and link proxy:
    https://xenforo.com/community/threads/exif-rotation-acp-searching-proxying-and-change-logging.66592/

    I'm not sure what your addon is really supposed to do, but if your are using the XF API addon, you should ask that dev to support a means to create the data-proxy-href tag for those links.

    I think the correct method to look for is in XenForo's Base class, and the _generateProxyLink method.
     
  3. Daniel-SP

    Daniel-SP Active Member

    Yeah, I know that. I used it to show as an example if that could have been performed, you know? You read and apply the rule when the link is posted.

    My doubt is if by using the link proxy feature is possible to handle this case rewriting the link following the rules after the click, during the redirection.

    It was a sample to show a possible cenario. My case is a bit more complicated than this.. As explained, if it was possible, I could ask a API for a URL and redirect the user to the response of the API.


    Edit: thanks for the link. Im going to check it.
     
  4. SneakyDave

    SneakyDave Well-Known Member

    ok, I think I understand. If you wanted to do that, you'd probably have to do it in the XenForo_ProxyOutput::run() method. I suppose you could redirect people, log clicks, etc. by extending that, if that is even possible.
     

Share This Page