9

I have no idea why this happened, but I am no longer able to copy text on my website (in Wordpress), kinda. I can paste text, but not copy text. And I can go to any other website and copy and paste text, but just not on my own. Both methods of copying (right click copy or control + C on windows) does not work on my website. But anyways, this problem applies only within text fields, like the style editor, header editor, the "quickpress" text field on the dashboard and even on the search field of my website. So I tried the following to fix this issue:

1) Disable my keyboard driver and restart my computer

2) Uninstall and reinstall my internet browser - Google Chrome

None of the above worked. But just recently, I I was able to copy and paste <script> text bit in my header.php file. I couldn't copy any other text but this and a few other snippets of code... which is very weird. But anyways, here is a code/text I copied and also what I get once I paste the code:

Original text that I copied:

<script src="http://code.jquery.com/jquery-1.9.0-min.js" type="text/javascript"></script>

Text I get when I paste original above text:

See more at: http://www.mywebsite.com/wp-admin/theme-editor.php?file=header.php&theme=mytheme2%2Fthemez2#sthash.WVvNmB7H.dpuf

Could this be a potential hacker or intruder into my website? I can't see any other explanation for this very strange error at this point. If anyone could help fix the copy and paste abilities for my website or come up with an explanation to this odd problem, it would really mean a lot.

Update:

This problem only persists in Google Chrome and Safari... not Mozilla or IE. And I stripped all of my java code and the problem still remains Hope that helps.

Dyck
  • 2,569
  • 4
  • 21
  • 21
  • I know it's possible to disable text selection in browsers, which makes copying impossible. Not sure about your specific case. http://stackoverflow.com/questions/826782/css-rule-to-disable-text-selection-highlighting – Mark Meyer Feb 26 '13 at 21:55
  • Could your wordpress theme be using something like this? https://github.com/jonrohan/ZeroClipboard – Jason Sperske Feb 26 '13 at 21:56
  • My theme doesn't use zero clipboard and nuclearghost, the link you provided didn't help this situation because you can still select text just not copy any text in text fields. Thanks for the input guys – Dyck Feb 26 '13 at 21:59

5 Answers5

15

I work on thehollywoodreporter.com. Our editors could no longer use the Drupal 6 CMS because of this sharethis change. When they tried to copy from one field to another in the cms, it would take the string and turn it into:

See more at: <text pasted>&action=edit#sthash.mOyzIP9P.dpuf

I seriously thought our site had been hacked for like 10 minutes. Luckily, the dev community started posting about it, and pointed out it was the new CopyNShare feature sharethis added. I commented out the sharethis code, so our editors could resume publishing, and we got on the phone with our sharethis contact, and they had us change this:

  <script type="text/javascript">var __st_loadLate=true;</script><script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>

to

<script type="text/javascript">var __st_loadLate=true;</script><script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>

<script type="text/javascript">stLight.options({publisher: "<your publisher key>", doNotHash:false, doNotCopy:true,hashAddressBar:false});</script>

Apparently, they made a change to their code so that you MUST add 'doNotCopy: true' in order for it NOT to add this hash when you cut and paste within your site! This is their new "product" CopyNShare.

I told them "I don’t think it was popular move to roll out this feature as a new default like this. I seriously thought our site had been hacked for 10-15 minutes. Not fun."

They replied: "I definitely understand your concern, as we share the same concerns on the pub services team. We will be doing a "postmortem" of sorts to ensure we change this process in the future when new product features are rolled out."

Nate
  • 174
  • 3
  • 1
    The ShareThis widget also breaks copying and pasting of code snippets. On one of our sites we had some example code for users to copy, the share this widget broke this functionality. All of the HTML tags were being stripped out, and the 'See more' message was being appended. It was really stupid of them to suddenly just turn this feature on. The fix described in the answer above sorted this out. – jd182 Aug 12 '13 at 10:36
4

As @Punit Pandey suggested, the ShareThis plugin started doing this today (February 27th 2013) without warning. You can disable this new functionality by adding the following JavaScript after the ShareThis-code has initialized:

stLight.options({doNotCopy:true});

The description for this new functionality can be found here: ShareThis CopyNShare Settings

JesperB
  • 4,625
  • 1
  • 36
  • 40
  • you must also replace this with – JinSnow Jul 04 '14 at 12:21
1

This is happening on my website due to ShareThis plugin. ShareThis adds this tag sthash and an identification ending with dpuf, I guess, to identify website.

Punit Pandey
  • 385
  • 1
  • 12
0

The problem stemmed from a plugin within Wordpress called "Digg Digg". I simply deactivated this plugin and there was no copy and pasting issues. :)

Dyck
  • 2,569
  • 4
  • 21
  • 21
0

I fixed this issue in Drupal 7 by changing modules/sharethis/sharethis.module around line 467

 // Provide the publisher ID.
  $stlight = drupal_json_encode(array(
    'publisher' => $data_options['publisherID'],
    **'doNotCopy' => "true",**
  ));

there doesnt appear to be any option to turn this off in the module config page. Very annoying!

user74847
  • 181
  • 1
  • 2
  • 12