~ubuntu-branches/ubuntu/utopic/mediatomb/utopic

« back to all changes in this revision

Viewing changes to src/scripting/js_functions.cc

  • Committer: Bazaar Package Importer
  • Author(s): Micah Gersten
  • Date: 2010-08-25 17:07:03 UTC
  • mfrom: (1.1.3 upstream) (4.1.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100825170703-fty3illodas34r1w
Tags: 0.12.1-0ubuntu1
* New upstream release (LP: #553269)
  + Drop patches applied upstream:
    - drop debian/patches/service-id_fix.patch
    - drop debian/patches/ffmpegthumbnailer-2.0.patch
    - drop debian/patches/autoreconf_-fi.patch
  + Refresh patch due to upstream changes
    - update debian/patches/const_char_conversion.patch

* Merge from debian unstable.  Remaining changes:
  - debian/control:
    + Don't depend on libmozjs-dev
    + Add OR depends on abrowser
  - debian/rules: Disable js support
  - fix LP: #569763 - mediatomb allows anyone to browse and export the whole 
    filesystem

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
    Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
8
                       Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
9
9
    
10
 
    Copyright (C) 2006-2009 Gena Batyan <bgeradz@mediatomb.cc>,
 
10
    Copyright (C) 2006-2010 Gena Batyan <bgeradz@mediatomb.cc>,
11
11
                            Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
12
                            Leonhard Wimmer <leo@mediatomb.cc>
13
13
    
24
24
    version 2 along with MediaTomb; if not, write to the Free Software
25
25
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
26
26
    
27
 
    $Id: js_functions.cc 2010 2009-01-11 19:10:43Z lww $
 
27
    $Id: js_functions.cc 2081 2010-03-23 20:18:00Z lww $
28
28
*/
29
29
 
30
30
/// \file js_functions.cc
156
156
        if (!str)
157
157
            path = _("/");
158
158
        else
159
 
            path = String(JS_GetStringBytes(str));
 
159
            path = JS_GetStringBytes(str);
160
160
 
161
161
        JSString *cont = JS_ValueToString(cx, argv[2]);
162
162
        if (cont)
163
163
        {
164
 
            containerclass = String(JS_GetStringBytes(cont));
 
164
            containerclass = JS_GetStringBytes(cont);
165
165
            if (!string_ok(containerclass) || containerclass == "undefined")
166
166
                containerclass = nil;
167
167
        }
233
233
        }
234
234
        else
235
235
        {
236
 
            path = i2i->convert(path);
 
236
            if (self->whoami() == S_PLAYLIST)
 
237
                path = p2i->convert(path);
 
238
            else
 
239
                path = i2i->convert(path);
 
240
            
237
241
            id = cm->addContainerChain(path, containerclass);
238
242
        }
239
243
 
249
253
            {
250
254
                if (pcd_id == INVALID_OBJECT_ID)
251
255
                    return JS_TRUE;
 
256
 
 
257
                /// \todo check why this if is needed?
 
258
                if (IS_CDS_ACTIVE_ITEM(cds_obj->getObjectType()))
 
259
                    cds_obj->setFlag(OBJECT_FLAG_PLAYLIST_REF);
252
260
                cds_obj->setRefID(pcd_id);
253
261
            }
254
262
            else
313
321
        {
314
322
            str = JS_ValueToString(cx, argv[0]);
315
323
            if (str)
316
 
                result = String(JS_GetStringBytes(str));
 
324
                result = JS_GetStringBytes(str);
317
325
        }
318
326
 
319
327
        if (result != nil)