CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Adding JS to a profile
Pages: [1]

Author Topic: Adding JS to a profile  (Read 1627 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Adding JS to a profile
April 17, 2009, 10:20:58 pm
Hi there,

Wanting to add a link like this to a profile but civi blocks it. What is the easiest way to meet a client's need for a sized popup box?

<SCRIPT LANGUAGE="javascript">
<!--
window.open ('titlepage.html', 'newwindow', config='height=100,
width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,
location=no, directories=no, status=no')
-->
</SCRIPT>
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Adding JS to a profile
April 17, 2009, 10:32:41 pm
to be more specific i was wanting to add as a link in a field help - but first time i tried it said something about 'script attack' but when i just redid it to try and get you the correct message it said 'suspicious activity'
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Adding JS to a profile
April 18, 2009, 09:09:32 am

easiest hack for now is to edit CRM/Corre/IDS.php

and add the field name to line 96

we need to rethink our IDS approach in a future release

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Adding JS to a profile
April 20, 2009, 04:45:12 am
Hmm - it works - right up until it doesn't


At line 134 of that file  I see it in the exclusions but with or without it in the html section it still fails

Please correct the following errors in the form fields below:

    * Illegal characters in input (potential scripting attack)


I've followed it through in debug but the zend_debugger key holds the error which is confusing.
Code: [Select]
$init Object of: IDS_Init
config Array [1]
General Array [8]
filter_type (string:3) xml
filter_path (string:85) c:/xampp/htdocs/classes2.2/sites/all/modules/civicrm//packages/IDS/default_filter.xml
tmp_path (string:49) c:/xampp/htdocs/classes2.2/files/civicrm/upload/\\
HTML_Purifier_Path (string:46) IDS/vendors/htmlpurifier/HTMLPurifier.auto.php
HTML_Purifier_Cache (string:49) c:/xampp/htdocs/classes2.2/files/civicrm/upload/\\
scan_keys (string:0)
exceptions Array [6]
0 (string:6) __utmz
1 (string:6) __utmc
2 (string:11) widget_code
3 (string:12) html_message
4 (string:9) help_post

html Array [17]
0 (string:11) description
1 (string:5) intro
2 (string:13) thankyou_text
3 (string:10) intro_text
4 (string:9) body_text
5 (string:11) footer_text
6 (string:13) thankyou_text
7 (string:15) thankyou_footer
8 (string:8) new_text
9 (string:12) renewal_text
10 (string:8) help_pre
11 (string:9) help_post
12 (string:8) msg_html
13 (string:13) confirm_title
14 (string:12) confirm_text
15 (string:19) confirm_footer_text
16 (string:18) confirm_email_text
IDS_Init::configPath (string:63) c:/xampp/htdocs/classes2.2/files/civicrm/upload/\\Config.IDS.ini


Guess I'll give up on this.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Adding JS to a profile
April 21, 2009, 03:17:14 am
But then again - you CAN add js to the wysiwyg field for a Profile (but not fields) which does kind of work
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Adding JS to a profile

This forum was archived on 2017-11-26.