July 16, 2013 · West Coast Media Solutions Inc. · 12 min read
The backslashes come from an old PHP setting, magic quotes, and scripts that escape text again. Make each script escape text itself, only when saving to the database, then turn the setting off and clean stored text once.
A backslash in every message
An enquiry arrives from the website's contact form. The sender's surname, O'Neill, has become O\'Neill, and every apostrophe in the message carries a backslash in front of it.
Pages edited through the site's own admin screens are worse. A heading saved once shows one backslash before its apostrophe. Edit it again and there are three; once more, seven.
Retyping the text removes them until the next save. The cause is not in the text at all, but in the way the server and the site's scripts handle it.
An old setting meant to protect databases
Older versions of PHP, the language behind many websites, have a setting called magic quotes. When it is on, the server adds a backslash before every apostrophe, quotation mark and backslash typed into a form.
The idea was to make text safe to place inside a database query, where a stray apostrophe can end a piece of text early and let the rest be read as commands.
It was a blunt tool. It changes everything typed into every form, whether or not it is headed for a database, and it leaves the clean-up to each script.
How the slashes pile up
The server adds one to every apostrophe and quotation mark sent from a form.
The script adds its own before saving, so the text is escaped twice.
The database keeps one of the two, and the page displays it.
The edit screen loads that backslash back into the box, ready to be escaped again.
The mail script never removes them, so every form email carries them.
The fourth explains the growth. Each save escapes the backslash already there as well as the apostrophe, so one becomes three, and three become seven.
The fifth needs no database at all, which is why a site with nothing but a contact form can show the same symptom.
What the mail script misses
Form emails are the simplest case. The mail script takes whatever the form sent and drops it into a message.
If the server has added backslashes and the script never strips them, they go straight into the inbox, on every enquiry, for as long as the site runs.
Platforms that add slashes themselves
WordPress adds the same slashes to form data on its own, whatever the server setting, so that older add-ons written with magic quotes in mind keep working.
A form add-on or theme that forgets to remove them shows the familiar backslashes even where the setting is off. There, the fix belongs in the add-on, not the server.
Why the setting cannot simply be switched off
Turning magic quotes off stops the slashes, but it also removes the only protection some old scripts ever had.
A script that relied on it, and never escaped text itself, is then open to attack.
An attacker types an apostrophe followed by database commands into a form, and the script runs them. Automated tools try this attack, known as SQL injection, on forms all over the web.
PHP 5.4 and later have no magic quotes at all, so the same exposure arrives when a host upgrades PHP. The scripts have to be made safe first, whichever way the change comes.
A worked example
A sign painter in Nelson letters shop windows, trucks and carved wooden signs, and gets most new work through a quote form that asks for the wording, the size and where the sign will go.
The wording arrived with a backslash before each apostrophe, and sizes in inches arrived with one before each inch mark. Twice she nearly lettered a backslash onto a customer's window.
The captions in her gallery, edited through a small admin page built years earlier, had grown to three or seven backslashes each. Her host still ran an older PHP with the setting on.
The admin page also escaped everything again before saving. A developer rewrote it to save through prepared statements, which keep text and query apart, and changed the quote form to send exactly what the customer typed.
Only then was the setting turned off for her site. The captions were cleaned once, after a backup, and the form was tested with wording full of apostrophes, inch marks and a stray backslash.
What a customer types is now what reaches her inbox, and a caption saved ten times comes back exactly as written.
Cleaning up what is already saved
Fixing the cause does not repair text saved while the fault was active. Pages, captions, product descriptions and customer records saved through the faulty script may all hold extra backslashes.
Clean them once, with a careful script run against a copy of the database before the live one.
Removing every backslash blindly can damage text that genuinely needs one, so look at what the script changes before trusting it.
Testing with awkward text
Keep a test sentence with an apostrophe, a pair of quotation marks, an inch mark and a backslash. Send it through every form and read the email that arrives.
Then save it into a page, open the page for editing, save it again without changes, and check that nothing has grown.
Run the same test after any change to the server or the scripts, including the host's PHP upgrades.
The counter-case
A site whose only form sends email, and which saves nothing, has an easier path. Removing the slashes inside the mail script fixes the symptom completely, and there is no stored text to clean.
And on a server already running PHP 5.4 or later, magic quotes cannot be the cause. The slashes there come from a platform or a script, which narrows the search.
Wherever a site saves form text, though, its scripts need to escape that text themselves, correctly and once. That protects the database whether the old setting is on, off or gone.
Fixing it at the source
Send a test message with an apostrophe, quotation marks and a backslash.
Ask the host which PHP version runs the site and whether magic quotes is on.
List every script that saves form text or sends it by email.
Make each script escape text itself, only where it saves to the database.
Turn magic quotes off once the scripts are safe without it.
Clean the stored text once, after a backup.
Save a page twice and check that nothing grows.
Step four has to come before step five. Switch the setting off first, and every old script that leaned on it is open to the very attacks it was meant to stop.
Why do form emails show backslashes before apostrophes?
The server adds them to everything typed into a form, through an old PHP setting called magic quotes, and the mail script never removes them before sending.
Why does the number of backslashes keep growing?
Each save escapes the backslash already in the text as well as the apostrophe, so one becomes three and three become seven after a few edits.
Can we just turn magic quotes off?
Only after the scripts escape text themselves. A script that relied on the setting becomes open to database attacks the moment it is switched off.
Will a PHP upgrade fix it?
PHP 5.4 and later have no magic quotes, so those slashes stop, but any script that relied on the setting loses its protection at the same moment.
Why does a WordPress site show them with the setting off?
WordPress adds slashes to form data itself, for the sake of older add-ons. An add-on or theme that forgets to remove them shows backslashes on any server.
What about text already saved with backslashes?
Fix the cause first, then clean the stored text once with a careful script, tried on a copy of the database before the live one.
West Coast Media Solutions Inc. provides web design, web development, hosting, digital marketing, and business consulting to organisations across Canada, drawing on more than twenty-five years in the field.
Backslashes turning up in your form emails?
Send us a form email that shows them, and we will trace where the slashes are added and fix the scripts safely.
West Coast Media Solutions Inc. ("Company," "we," "us," or "our") respects your privacy and is committed to protecting the personal information you share with us. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you visit our website, including any subdomains, and any related services, applications, or tools where this policy is referenced.
2. Information We Collect
We may collect personal information that you voluntarily provide when you use our contact forms, subscribe to newsletters, request a quote, or otherwise interact with our website. This may include your name, email address, phone number, company name, and any additional details you choose to share in message fields. We also automatically collect certain technical data when you visit our website, including your IP address, browser type, operating system, referring URLs, pages viewed, time spent on pages, and access timestamps.
3. How We Use Your Information
We use the information we collect to respond to your inquiries and provide requested services; to personalize and improve your experience on our website; to send you project updates, newsletters, and promotional communications (which you may opt out of at any time); to analyze usage trends and improve website performance; to detect, prevent, and address fraud, security issues, and technical problems; and to comply with applicable legal obligations and enforce our terms.
4. Cookies and Tracking Technologies
Our website uses cookies and similar tracking technologies to enhance your browsing experience, remember your preferences, and gather analytical data about how visitors use our site. You can control cookie preferences through your browser settings. For detailed information about our use of cookies, please see our Cookie Policy.
5. Third-Party Services
We may use third-party analytics services such as Matomo or Google Analytics to help us understand how visitors interact with our website. These services may collect information sent by your browser as part of a web page request, including cookies and your IP address. We may also use third-party services for email delivery, form processing, and content delivery networks. These providers have their own privacy policies governing the use of your information.
6. Data Sharing and Disclosure
We do not sell, trade, or rent your personal information to third parties. We may share your information with trusted service providers who assist us in operating our website and conducting our business, provided they agree to keep this information confidential. We may also disclose information when required by law, to protect our rights, to enforce our policies, or to respond to legal process.
7. Data Security
We implement appropriate technical and organizational measures to protect the personal information we collect and store. These include encrypted connections (SSL/TLS), secure server infrastructure, access controls, and regular security assessments. However, no method of transmission over the internet or electronic storage is 100% secure, and we cannot guarantee absolute security of your data.
8. Data Retention
We retain your personal information only for as long as necessary to fulfill the purposes for which it was collected, to comply with legal obligations, resolve disputes, and enforce our agreements. Contact form submissions and inquiry records are retained for a reasonable period based on the nature of the inquiry and applicable retention requirements. You may request deletion of your data at any time.
9. Your Rights
Depending on your jurisdiction, you may have the right to access, correct, update, or delete the personal information we hold about you. You may also have the right to object to or restrict certain processing of your data, to data portability, and to withdraw consent where processing is based on consent. To exercise any of these rights, please contact us using the information provided below. We will respond to your request within the timeframes required by applicable law.
10. Children's Privacy
Our website and services are not intended for individuals under the age of 16. We do not knowingly collect personal information from children. If we become aware that we have inadvertently collected personal data from a child under 16, we will take steps to delete such information promptly. If you believe we may have collected information from a child, please contact us immediately.
11. International Data Transfers
Your information may be transferred to and maintained on servers located outside your province, state, or country where data protection laws may differ from those in your jurisdiction. By providing your information, you consent to such transfer. We take steps to ensure that your data is treated securely and in accordance with this Privacy Policy regardless of where it is processed.
12. Changes to This Policy
We reserve the right to update or modify this Privacy Policy at any time. Any changes will be posted on this page with an updated effective date. We encourage you to review this policy periodically to stay informed about how we are protecting your information. Your continued use of the website after any changes constitutes acceptance of the revised policy.
Effective Date: April 2026 | West Coast Media Solutions Inc., Vancouver, BC, Canada
Cookie Policy
1. What Are Cookies
Cookies are small text files that are placed on your computer, smartphone, or other device when you visit a website. They are widely used to make websites work more efficiently, to provide a better browsing experience, and to supply reporting information to website operators. Cookies are stored in your browser and allow the website or a third-party service to recognize you and make your next visit easier.
2. How We Use Cookies
West Coast Media Solutions Inc. uses cookies for several purposes: to ensure the proper functioning and security of our website; to remember your preferences and settings; to understand how visitors navigate and interact with our pages; to analyze website traffic and measure the effectiveness of our content; and to deliver relevant information based on your browsing history and interests.
3. Types of Cookies We Use
Essential Cookies: These cookies are strictly necessary for the website to function. They enable core features such as page navigation, secure areas, and form submissions. The website cannot function properly without these cookies, and they cannot be disabled.
Analytics Cookies: These cookies help us understand how visitors interact with our website by collecting information about pages visited, time spent on the site, and any error messages encountered. All information collected by these cookies is aggregated and therefore anonymous.
Functional Cookies: These cookies enable the website to remember choices you make (such as your preferred language or region) and provide enhanced, more personalized features. They may also be used to provide services you have requested, such as watching a video or commenting on a blog.
Performance Cookies: These cookies collect information about how you use our website, such as which pages are most popular and how visitors move around the site. This helps us improve the way our website works and identify any technical issues.
4. Third-Party Cookies
In addition to our own cookies, we may also use various third-party cookies to report usage statistics of the website and deliver content and advertisements. Third-party services that may place cookies through our site include analytics providers, advertising networks, and social media platforms. These third parties have their own cookie and privacy policies that govern their use of your data.
5. Cookie Duration
Session Cookies: These cookies are temporary and are deleted from your device when you close your browser. They are used to maintain your session as you navigate between pages.
Persistent Cookies: These cookies remain on your device for a set period of time or until you delete them. They are used to remember your preferences and actions across multiple visits to our website.
6. Managing Your Cookie Preferences
Most web browsers allow you to control cookies through their settings. You can configure your browser to accept all cookies, reject all cookies, or notify you when a cookie is set. Please note that disabling or blocking certain cookies may affect the functionality of our website and your ability to access certain features. Browser help sections and external resources provide detailed instructions on managing cookies for all major browsers.
7. Do Not Track Signals
Some browsers include a "Do Not Track" (DNT) feature that signals to websites that you do not want your activity tracked. Because there is no universally accepted standard for how to respond to DNT signals, our website does not currently respond to DNT signals. However, you can control tracking through the cookie management options described above.
8. Consent
By continuing to use our website, you consent to the use of cookies as described in this Cookie Policy. If you do not agree to our use of cookies, you should adjust your browser settings accordingly or refrain from using our website. For users in jurisdictions that require explicit consent (such as the EU/EEA), we will present a cookie consent mechanism before non-essential cookies are placed.
9. Impact on Website Functionality
If you choose to disable cookies, some features of our website may not function as intended. This could include the inability to log in, loss of personalization, reduced analytics capabilities, and degraded overall experience. Essential cookies cannot be disabled as they are required for the basic operation of the website.
10. Updates to This Cookie Policy
We may update this Cookie Policy from time to time to reflect changes in technology, legislation, our business operations, or cookie practices. Any updates will be posted on this page with a revised effective date. We encourage you to check this page periodically to stay informed about our use of cookies.
Effective Date: April 2026 | West Coast Media Solutions Inc., Vancouver, BC, Canada
Terms of Use
1. Acceptance of Terms
By accessing and using the website operated by West Coast Media Solutions Inc. ("Company," "we," "us," or "our"), located at westcoastmediasolutions.com (the "Website"), you acknowledge that you have read, understood, and agree to be bound by these Terms of Use. If you do not agree to these Terms, you must discontinue use of this Website immediately. We reserve the right to modify these Terms at any time, and such modifications shall be effective immediately upon posting.
2. Description of Services
West Coast Media Solutions Inc. provides digital marketing and web design services including, but not limited to, search engine optimization, search engine marketing, social media marketing, rich media advertising, programmatic media buying, digital consulting, and custom website design and development. The information presented on this Website is intended for general informational purposes and does not constitute a binding offer, contract, or guarantee of results.
3. Eligibility
You must be at least 18 years of age, or the age of majority in your jurisdiction (whichever is greater), to use this Website or engage our services. By using this Website, you represent and warrant that you meet this eligibility requirement and that you have the legal capacity to enter into a binding agreement.
4. Intellectual Property Rights
All content, materials, features, and functionality on this Website, including but not limited to text, graphics, logos, icons, images, audio clips, video clips, data compilations, software, and the design, selection, and arrangement thereof, are the exclusive property of West Coast Media Solutions Inc. or its content suppliers and are protected by Canadian and international copyright, trademark, patent, trade secret, and other intellectual property laws.
5. User Conduct
When using this Website, you agree not to use the Website for any unlawful purpose; attempt to gain unauthorized access to any portion of the Website or any systems connected to it; interfere with or disrupt the operation of the Website; use automated means to access or copy content without our express written consent; collect personal information of other users; impersonate any person or entity; or engage in any activity that could damage or impair the Website.
6. Submissions and Contact Forms
Any information or materials you submit through the Website's contact forms, email, or other communication channels shall be treated as non-confidential and non-proprietary unless otherwise specified in a separate written agreement. By submitting any such information, you grant the Company a non-exclusive, royalty-free, perpetual right to use, reproduce, modify, and distribute such content for any lawful business purpose.
7. Third-Party Links
This Website may contain links to third-party websites that are not owned or controlled by West Coast Media Solutions Inc. We have no control over, and assume no responsibility for, the content, privacy policies, or practices of any third-party websites. Your use of third-party websites is at your own risk, and we encourage you to read the terms and privacy policies of any websites you visit.
8. Disclaimer of Warranties
THIS WEBSITE AND ALL CONTENT, MATERIALS, INFORMATION, AND SERVICES PROVIDED ON OR THROUGH THIS WEBSITE ARE PROVIDED ON AN "AS IS" AND "AS AVAILABLE" BASIS WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, THE COMPANY DISCLAIMS ALL WARRANTIES, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT.
9. Limitation of Liability
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, WEST COAST MEDIA SOLUTIONS INC., ITS DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, PARTNERS, SUPPLIERS, OR AFFILIATES SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES ARISING FROM OR RELATED TO YOUR USE OF THE WEBSITE, WHETHER BASED ON WARRANTY, CONTRACT, TORT, OR ANY OTHER LEGAL THEORY.
10. Indemnification
You agree to defend, indemnify, and hold harmless West Coast Media Solutions Inc., its directors, officers, employees, agents, successors, and assigns from any claims, damages, obligations, losses, liabilities, costs, and expenses arising from your use of the Website, your violation of these Terms, or your violation of any third-party right.
11. Governing Law and Jurisdiction
These Terms shall be governed by and construed in accordance with the laws of the Province of British Columbia and the federal laws of Canada applicable therein. Any legal action arising from these Terms shall be instituted exclusively in the courts of British Columbia, Canada. You irrevocably waive any objections to jurisdiction and venue in such courts.
12. Changes to These Terms
We reserve the right to update or modify these Terms of Use at any time. Changes will be posted on this page with an updated effective date. Your continued use of the Website following the posting of revised Terms constitutes your acceptance of such changes.
Effective Date: April 2026 | West Coast Media Solutions Inc., Vancouver, BC, Canada
Legal Terms
1. Company Information
This website is owned and operated by West Coast Media Solutions Inc., a corporation incorporated federally under the Canada Business Corporations Act (corporation number 641461-3) and extraprovincially registered in British Columbia (registration number A0143178). Our registered office is located at 2400 - 1111 West Georgia Street, Vancouver, BC V6E 4S4, Canada. Telephone: (800) 959-4590.
2. Responsible for Content
The content of this website is provided by West Coast Media Solutions Inc. The person responsible for the content within the meaning of applicable legislation is the managing director of West Coast Media Solutions Inc., contactable at the registered office address listed above. All editorial content, service descriptions, and portfolio materials are reviewed and approved prior to publication.
3. Content Accuracy and Disclaimer
The contents of this website have been prepared with the utmost care. However, West Coast Media Solutions Inc. cannot guarantee the accuracy, completeness, or timeliness of the content provided. All information is subject to change without notice. We are not obligated to monitor transmitted or stored third-party information, nor to investigate circumstances that indicate unlawful activity. If we become aware of any such infringements, we will remove the content immediately.
4. External Links Disclaimer
Our website contains links to external websites of third parties over whose content we have no influence. We cannot assume any liability for third-party content. The respective provider or operator of the linked pages is always responsible for the content of those pages. Linked pages were checked for possible legal violations at the time of linking. Illegal content was not recognizable at the time of linking. Permanent monitoring of linked pages is not reasonable without concrete evidence of a violation.
5. Copyright and Intellectual Property
The content and works created by the operators of this website are subject to Canadian copyright law. Reproduction, editing, distribution, and any kind of exploitation outside the limits of copyright law require the written consent of the respective author or creator. Downloads and copies of this site are only permitted for private, non-commercial use. Third-party content is identified as such. Should you become aware of a copyright infringement, please notify us accordingly.
6. Trademark Notice
All trademarks, service marks, trade names, logos, and product names appearing on this website are the property of their respective owners. West Coast Media Solutions Inc. and the WCMS logo are trademarks of West Coast Media Solutions Inc. Reference to any products, services, or information by trade name, trademark, or otherwise does not constitute or imply endorsement, sponsorship, or recommendation by the company.
7. Professional Liability
Our liability for services rendered is governed by the terms of the individual service agreement executed between the Company and the client. Insurance requirements, where applicable to a particular engagement, are addressed in that agreement.
8. Dispute Resolution
West Coast Media Solutions Inc. endeavours to resolve any disputes arising from or in connection with our services amicably and directly with our clients. If a dispute cannot be resolved informally, it shall be governed by the laws of the Province of British Columbia and the federal laws of Canada applicable therein. The courts of British Columbia shall have exclusive jurisdiction over any dispute arising from or related to this website or the services provided.
9. Regulatory Compliance
West Coast Media Solutions Inc. operates in compliance with all applicable federal, provincial, and municipal laws and regulations, including but not limited to Canada's Anti-Spam Legislation (CASL), the Personal Information Protection and Electronic Documents Act (PIPEDA), the British Columbia Personal Information Protection Act (PIPA), the Competition Act, and all applicable advertising standards as set forth by Ad Standards Canada.
10. Limitation of Liability
To the fullest extent permitted by applicable law, West Coast Media Solutions Inc. and its officers, directors, employees, agents, and affiliates shall not be liable for any direct, indirect, incidental, special, consequential, or exemplary damages arising from or related to your use of the website, including but not limited to loss of data, loss of income, or loss of business opportunity, even if we have been advised of the possibility of such damages.
11. Severability
If any provision of these Legal Terms is held to be unenforceable or invalid by a court of competent jurisdiction, such provision shall be modified to accomplish the objectives of the original provision to the fullest extent permitted by law, and the remaining provisions shall continue in full force and effect.
12. Contact
If you have any questions regarding these Legal Terms, please contact West Coast Media Solutions Inc. at 2400 - 1111 West Georgia Street, Vancouver, BC V6E 4S4, Canada. Telephone: (800) 959-4590.
Last updated: April 2026
Accessibility Statement
1. Our Commitment
West Coast Media Solutions Inc. is committed to ensuring digital accessibility for people of all abilities. We continually work to improve the user experience for everyone who visits our website and strive to conform to applicable accessibility standards and guidelines. We believe the internet should be available and accessible to anyone, and we are committed to providing a website that is accessible to the widest possible audience.
2. Standards and Guidelines
We aim to conform to the Web Content Accessibility Guidelines (WCAG) 2.1 at the AA level, published by the World Wide Web Consortium (W3C). These guidelines provide a framework for making web content more accessible to people with disabilities, including visual, auditory, physical, speech, cognitive, language, learning, and neurological disabilities. Conformance with these guidelines also helps make web content more usable for all users.
3. Measures Taken
To ensure accessibility, we have implemented the following measures across our website: semantic HTML5 markup for proper document structure and screen reader compatibility; descriptive alt text for all meaningful images; sufficient color contrast ratios between text and background elements; keyboard-navigable interface elements including menus, links, buttons, and form fields; clear and consistent navigation structure throughout all pages; responsive design that adapts to different screen sizes, devices, and zoom levels; and descriptive link text that provides context about link destinations.
4. Assistive Technology Compatibility
Our website is designed to be compatible with commonly used assistive technologies, including screen readers such as JAWS, NVDA and VoiceOver, screen magnification software, speech recognition software, and alternative input devices. We build to accessibility standards and use automated testing tools during development. Where a specific assistive technology presents a barrier, we welcome reports so we can address it.
5. Multimedia Content
We strive to ensure that multimedia content on our website is accessible. Where video or audio content is provided, we aim to include captions, transcripts, or audio descriptions as appropriate. Images used for decorative purposes are marked accordingly so they do not interfere with screen reader navigation.
6. Document Accessibility
We are working to ensure that downloadable documents and files published on our website are accessible. Where possible, we provide content in accessible HTML format in addition to or instead of PDF format. For PDF documents, we strive to ensure they are properly tagged and structured for assistive technology access.
7. Third-Party Content
Our website may include content or functionality provided by third-party services, including embedded videos, social media feeds, analytics tools, and web fonts. While we make every effort to select accessible third-party solutions, we cannot guarantee that all third-party content meets accessibility standards. We welcome feedback on any third-party content that may present accessibility barriers.
8. Ongoing Efforts
Accessibility is an ongoing effort. We regularly review our website for accessibility issues, train our content team on accessibility best practices, incorporate accessibility testing into our development workflow, conduct periodic audits using both automated tools and manual testing, and monitor feedback from users to identify areas for improvement. We are committed to addressing any issues promptly and transparently.
9. Known Limitations
Despite our best efforts, some content on our website may not yet be fully accessible. We are aware that older content, certain complex interactive elements, and some third-party integrations may present challenges. We are actively working to address these limitations and improve accessibility across all areas of our website. If you encounter a specific barrier, please let us know so we can prioritize a solution.
10. Feedback and Contact
We welcome your feedback on the accessibility of our website. If you encounter accessibility barriers, have suggestions for improvement, or need assistance accessing any content or functionality, please contact us. You can reach West Coast Media Solutions Inc. at 2400 - 1111 West Georgia Street, Vancouver, BC V6E 4S4, Canada, or by telephone at (800) 959-4590. We aim to respond to accessibility feedback within 5 business days and to resolve reported issues as quickly as possible.
Last updated: April 2026 | West Coast Media Solutions Inc., Vancouver, BC, Canada