6 Replies Latest reply on Jul 30, 2007 8:25 AM by Newsgroup_User

    AC_RunRunActiveContent.js bug.

    Nathan Whelchel

      ******BUG******
      AC_RunRunActiveContent.js bug.

      When specifying content to run, and parameters are provided, the parameters are not dealt with properly.

      Both AC_FL_RunContent() and AC_SW_RunContent() both call AC_GetArgs() where if the parameter is "src" or "movie" calls AC_AddExtension(), which is the failing function.

      Take a look, here is the original function:

      function AC_AddExtension(src, ext)
      {
      if (src.indexOf('?') != -1)
      return src.replace(/\?/, ext+'?');
      else
      return src + ext;
      }

      Do you see the problem? It's obvious isn't it?

      The function call to String.replace specifies a match on the literal "?" and simply adds the extension (.swf or .dcr depending) and appends a single "?" after it. Sound lame? Well it is. Here is the proper function which matches on a "?" and everything after it, adds the extension and appends the rest of the string (i.e the "?" and everything after it), not just a single "?", as it should be:

      function AC_AddExtension(src, ext)
      {
      if (src.indexOf('?') != -1)
      return src = src.replace(/\?.*/, ext+'$&' );
      else
      return src + ext;
      }

      Replace this function with the standard one that comes with CS3 to get the proper parameter handling.

      Nathan
        • 1. Re: AC_RunRunActiveContent.js bug.
          Level 7
          Nathan Whelchel wrote:
          > ******BUG******
          > AC_RunRunActiveContent.js bug.

          At a quick glance, your analysis seems correct. Have you submitted this
          through the bug report form?

          http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

          --
          David Powers, Adobe Community Expert
          Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
          Author, "PHP Solutions" (friends of ED)
          http://foundationphp.com/
          • 2. Re: AC_RunRunActiveContent.js bug.
            Level 7
            How can I demostrate this bug? It's always worked well for me.

            > Replace this function with the standard one that comes with CS3 to get the
            > proper parameter handling.

            Don't you mean -

            Replace the standard one that comes with CS3 with this function to get the
            proper parameter handling.

            ???

            --
            Murray --- ICQ 71997575
            Adobe Community Expert
            (If you *MUST* email me, don't LAUGH when you do so!)
            ==================
            http://www.dreamweavermx-templates.com - Template Triage!
            http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
            http://www.dwfaq.com - DW FAQs, Tutorials & Resources
            http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
            ==================


            "Nathan Whelchel" <webforumsuser@macromedia.com> wrote in message
            news:f8jp1j$n5s$1@forums.macromedia.com...
            > ******BUG******
            > AC_RunRunActiveContent.js bug.
            >
            > When specifying content to run, and parameters are provided, the
            > parameters
            > are not dealt with properly.
            >
            > Both AC_FL_RunContent() and AC_SW_RunContent() both call AC_GetArgs()
            > where if
            > the parameter is "src" or "movie" calls AC_AddExtension(), which is the
            > failing
            > function.
            >
            > Take a look, here is the original function:
            >
            > function AC_AddExtension(src, ext)
            > {
            > if (src.indexOf('?') != -1)
            > return src.replace(/\?/, ext+'?');
            > else
            > return src + ext;
            > }
            >
            > Do you see the problem? It's obvious isn't it?
            >
            > The function call to String.replace specifies a match on the literal "?"
            > and
            > simply adds the extension (.swf or .dcr depending) and appends a single
            > "?"
            > after it. Sound lame? Well it is. Here is the proper function which
            > matches
            > on a "?" and everything after it, adds the extension and appends the rest
            > of
            > the string (i.e the "?" and everything after it), not just a single "?",
            > as it
            > should be:
            >
            > function AC_AddExtension(src, ext)
            > {
            > if (src.indexOf('?') != -1)
            > return src = src.replace(/\?.*/, ext+'$&' );
            > else
            > return src + ext;
            > }
            >
            > Replace this function with the standard one that comes with CS3 to get the
            > proper parameter handling.
            >
            > Nathan
            >


            • 3. Re: AC_RunRunActiveContent.js bug.
              Level 7
              Murray *ACE* wrote:
              > How can I demostrate this bug? It's always worked well for me.

              I haven't tested it, Murray, but I think this applies only if you add
              FlashVars to the URL.

              --
              David Powers, Adobe Community Expert
              Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
              Author, "PHP Solutions" (friends of ED)
              http://foundationphp.com/
              • 4. Re: AC_RunRunActiveContent.js bug.
                Level 7
                Ahh - right....

                I've not used that capability.

                --
                Murray --- ICQ 71997575
                Adobe Community Expert
                (If you *MUST* email me, don't LAUGH when you do so!)
                ==================
                http://www.dreamweavermx-templates.com - Template Triage!
                http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
                ==================


                "David Powers" <david@example.com> wrote in message
                news:f8kjvm$ooe$1@forums.macromedia.com...
                > Murray *ACE* wrote:
                >> How can I demostrate this bug? It's always worked well for me.
                >
                > I haven't tested it, Murray, but I think this applies only if you add
                > FlashVars to the URL.
                >
                > --
                > David Powers, Adobe Community Expert
                > Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
                > Author, "PHP Solutions" (friends of ED)
                > http://foundationphp.com/


                • 5. Re: AC_RunRunActiveContent.js bug.
                  Nathan Whelchel Level 1
                  Yes, I submitted a bug report - I thought I share this here though and provide an interim solution to an official fix.

                  Yes, I meant replace the CS3 version with the one in the post.

                  Yes, there is only a problem if you pass parameters.

                  Regards,
                  Nathan
                  • 6. Re: AC_RunRunActiveContent.js bug.
                    Level 7
                    Thanks for the clarification.

                    --
                    Murray --- ICQ 71997575
                    Adobe Community Expert
                    (If you *MUST* email me, don't LAUGH when you do so!)
                    ==================
                    http://www.dreamweavermx-templates.com - Template Triage!
                    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                    http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
                    ==================


                    "Nathan Whelchel" <webforumsuser@macromedia.com> wrote in message
                    news:f8kvk6$94n$1@forums.macromedia.com...
                    > Yes, I submitted a bug report - I thought I share this here though and
                    > provide
                    > an interim solution to an official fix.
                    >
                    > Yes, I meant replace the CS3 version with the one in the post.
                    >
                    > Yes, there is only a problem if you pass parameters.
                    >
                    > Regards,
                    > Nathan
                    >
                    >