Results 1 to 7 of 7

What does Javascipt do?

This is a discussion on What does Javascipt do? within the General Discussion forums, part of the vBSEO SEO Plugin category; We are trying to track down a SQL injection and I came across this block of code that I notice ...

  1. #1
    kau
    kau is offline
    Senior Member
    Real Name
    Alan
    Join Date
    Aug 2006
    Posts
    104
    Liked
    0 times

    What does Javascipt do?

    We are trying to track down a SQL injection and I came across this block of code that I notice we have but lots of other installs of vBSEO other people are running lack.

    <script type="text/javascript">
    //<![CDATA[

    window.orig_onload = window.onload;
    window.onload = function() {
    var cpost=document.location.hash.substring(1);var cpost2='';if(cpost){ var ispost=cpost.substring(0,4)=='post';if(ispost)cpos t2='post_'+cpost.substring(4);if((cobj = fetch_object(cpost))||(cobj = fetch_object(cpost2))){cobj.scrollIntoView(true);} else if(ispost){cpostno = cpost.substring(4,cpost.length);if(parseInt(cpostn o)>0){location.replace('http://www.XXXX.com/showthread.php?p='+cpostno);};} }

    if(typeof window.orig_onload == "function") window.orig_onload();
    }

    //]]>
    </script>


    What does that code do and what setting is putting it there?

  2. #2
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    This allows the permalink in the post bit to scroll into view when clicked (or linked). It is ok to have and isn't an exploit.

  3. #3
    Ky!
    Ky! is offline
    Senior Member Ky!'s Avatar
    Real Name
    KK
    Join Date
    Nov 2007
    Location
    Germany
    Posts
    161
    Liked
    0 times
    This produces crawling errors ( seen in webmaster tools ), how to fix it?

    Or in german: Code verursacht crawling fehler

  4. #4
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    Google is indexing this incorrectly. There is nothing here to index on regular threads, only threads using the pagination.

    ie

    What does Javascipt do?
    will always be blank
    but
    What does Javascipt do?
    has a hash and a cpostno var to fill in.


    google needs to refine there JS indexing, because it's clearly broken right now. If its giving you 404s, just ignore it. a thread without a postId SHOULD 404.

  5. #5
    kau
    kau is offline
    Senior Member
    Real Name
    Alan
    Join Date
    Aug 2006
    Posts
    104
    Liked
    0 times
    Is there a way to disable this chunk of Javascript by modifying a plugin?

    Like wrapping a plugin in a IF condition to see if the userid is greater then 0. Not looking for the code but what plugin it would be in or if it's not and it would be a file hack.

    My issue is I have that option set but in postbit I put an IF condition around it so guests don't see post links.

  6. #6
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    It would require a code edit in the vbseo php files.

  7. #7
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,742
    Liked
    168 times
    You can modify functions_vbseo_hook.php file:
    find:
    if(!strstr($_SERVER['HTTP_REFERER'],$_SERVER['VBSEO_URI']) && !vbseo_is_threadedmode())
    add above:
    if(0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •